From owner-freebsd-fs@freebsd.org Mon Sep 11 10:20:55 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 6D06FE028E5 for ; Mon, 11 Sep 2017 10:20:55 +0000 (UTC) (envelope-from Nikolaus@rath.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3BE7F276 for ; Mon, 11 Sep 2017 10:20:54 +0000 (UTC) (envelope-from Nikolaus@rath.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7D15220C21 for ; Mon, 11 Sep 2017 06:20:53 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 11 Sep 2017 06:20:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=zkIiic3t2LXSBV4PMMefP9ZORKWuAaI70v7sJ4MPCWM=; b=Ear0xZp2 wzeyCfG4G8LaeYLln6Pyw/d0TrN72piwNi/f/SvD+eVmVFGKZHMvEML3n7UVC4/L t+uvwGkacek0x/cJ+SGh6HJAcphPCr82h70QAnoL0ueC7EFiFzQlBKHSYYgaN6sA zDYwSxCVxA/HWZwvrr7311kqlUKG5dgF4sry0ZRfGG9M9yzAfszJdntOrLb+hVmk ympe3ng30ajIPxV4ObfmN23LoqnhZNvDDQNVsYMaRtabw6bd8hTZB5GCK+MEq7iU 8cG2gnHdosAlFEq1J2zDJ6fDBGxGh17waDEJ98JYWGix5q2T69rnLioV/lQV/ZMS 13fmcm+kJsbIxw== X-ME-Sender: X-Sasl-enc: XgyprrMOPev39c+AS3DWgEaQp18hGunnbBMYobJTWR5B 1505125253 Received: from ebox.rath.org (ebox.rath.org [45.79.69.51]) by mail.messagingengine.com (Postfix) with ESMTPA id 399E5240B3 for ; Mon, 11 Sep 2017 06:20:53 -0400 (EDT) Received: from vostro.rath.org (vostro [192.168.12.4]) by ebox.rath.org (Postfix) with ESMTPS id 40E04113 for ; Mon, 11 Sep 2017 10:20:52 +0000 (UTC) Received: by vostro.rath.org (Postfix, from userid 1000) id DF775102310; Mon, 11 Sep 2017 11:20:50 +0100 (BST) From: Nikolaus Rath To: freebsd-fs@freebsd.org 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> <201709081143.v88BhEOn001626@higson.cam.lispworks.com> <87lglp6zj8.fsf@vostro.rath.org> Mail-Copies-To: never Mail-Followup-To: freebsd-fs@freebsd.org Date: Mon, 11 Sep 2017 11:20:50 +0100 In-Reply-To: <87lglp6zj8.fsf@vostro.rath.org> (Nikolaus Rath's message of "Fri, 08 Sep 2017 15:22:19 +0100") Message-ID: <87a821a64d.fsf@vostro.rath.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Mon, 11 Sep 2017 10:20:55 -0000 On Sep 08 2017, Nikolaus Rath wrote: > On Sep 08 2017, Martin Simmons wrote: >>>>>>> On Thu, 07 Sep 2017 21:14:32 +0200, Nikolaus Rath said: >>>=20 >>> On Sep 05 2017, Martin Simmons wrote: >>> >> Probably the crucial difference is that the test that takes long exi= ts >>> >> its main loop on its own and then informs the FUSE kernel module abo= ut >>> >> that, while the other tests terminate the main loop because the kern= el >>> >> module tells them to do so. >>> > >>> > What does "informs the FUSE kernel module about that" do to inform it? >>>=20 >>> 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 t= he >> Linux code in https://github.com/libfuse/libfuse/blob/master/lib/mount.c= #L275 >> does? > > That sounds reasonable, will give it a shot. This indeed fixed the problem. Thanks! Best, -Nikolaus --=20 GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2= =AB