From owner-freebsd-fs@freebsd.org Fri Sep 8 11:43:25 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46CC1E130C8 for ; Fri, 8 Sep 2017 11:43:25 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from lwfs1-cam.cam.lispworks.com (mail.lispworks.com [46.17.166.21]) by mx1.freebsd.org (Postfix) with ESMTP id A74026AFAA for ; Fri, 8 Sep 2017 11:43:23 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (higson.cam.lispworks.com [192.168.1.7]) by lwfs1-cam.cam.lispworks.com (8.15.2/8.15.2) with ESMTP id v88BhEZb076758; Fri, 8 Sep 2017 12:43:14 +0100 (BST) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (localhost.localdomain [127.0.0.1]) by higson.cam.lispworks.com (8.14.4) id v88BhEL5001630; Fri, 8 Sep 2017 12:43:14 +0100 Received: (from martin@localhost) by higson.cam.lispworks.com (8.14.4/8.14.4/Submit) id v88BhEOn001626; Fri, 8 Sep 2017 12:43:14 +0100 Date: Fri, 8 Sep 2017 12:43:14 +0100 Message-Id: <201709081143.v88BhEOn001626@higson.cam.lispworks.com> From: Martin Simmons To: freebsd-fs@freebsd.org In-reply-to: <87ingugw2v.fsf@thinkpad.rath.org> (message from Nikolaus Rath on Thu, 07 Sep 2017 21:14:32 +0200) Subject: Re: umount() taking minutes for FUSE filesystems References: <87bmn44ruu.fsf@vostro.rath.org> <87o9qyrbs8.fsf@vostro.rath.org> <2FAD66DE-031B-4B36-9E85-C7BC6B52B5E6@gmail.com> <29de6425-9f92-3bd8-f446-1c9dded33b15@freebsd.org> <87k21dzdrp.fsf@thinkpad.rath.org> <201709051811.v85IBmbO005440@higson.cam.lispworks.com> <87ingugw2v.fsf@thinkpad.rath.org> X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 11:43:25 -0000 >>>>> On Thu, 07 Sep 2017 21:14:32 +0200, Nikolaus Rath said: > > On Sep 05 2017, Martin Simmons wrote: > >> Probably the crucial difference is that the test that takes long exits > >> its main loop on its own and then informs the FUSE kernel module about > >> that, while the other tests terminate the main loop because the kernel > >> module tells them to do so. > > > > What does "informs the FUSE kernel module about that" do to inform it? > > It calls unmount. > https://github.com/libfuse/libfuse/blob/master/lib/mount_bsd.c#L127 It seems to me that the following occurs: 1. The user program exits the main loop. 2. The user program sends unmount to the kernel. 3. The kernel sends FUSE_DESTROY to the user program. 4. The kernel waits for the user program to respond to FUSE_DESTROY. 5. The user program does not respond because it has exited the main loop. 6. The kernel wait times out after 60 seconds. Perhaps the solution is to close the fd before calling unmount(), like the Linux code in https://github.com/libfuse/libfuse/blob/master/lib/mount.c#L275 does? That will prevent the kernel from sending FUSE_DESTROY, but what is the purpose of FUSE_DESTROY if the user program can't respond to it? __Martin