From owner-freebsd-fs@freebsd.org Fri Sep 8 14:54: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 E4870E1C304 for ; Fri, 8 Sep 2017 14:54:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1F8D8252C for ; Fri, 8 Sep 2017 14:54:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f181.google.com with SMTP id v72so5965825ywa.3 for ; Fri, 08 Sep 2017 07:54:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to; bh=LaOEVO7M/7fHC3WL1EfJF2nbz4/1LQYJLOr+6oY35ms=; b=rX2x4nWcPcet8Me2jHBvXS6wYmxjcbGsRTZWLZxhEUZTpG4bX9FYtve/art5gTSUYX fWXgrAo6a8LvbFxUsUPDSQ1THsDyxcroz9jv2jm2DrzA2WD1o7bfnAysFJnpf3BrywhI tahZtNJcmdbb19f1vaycWJFPuw1kSeQLXg15UIJciNPcIW/8ack6F8b+RuuuBsYnIGo7 yj11N0puThu6gu4pZIvySP0x2v5DKcNcIoUtr/nkwMamAT+JV7irEuQRinMJrHzbRLFw YaT2dWQ1aiZar7MKDi2eqFCrMyvwgtalTRluig5CnyPQ7DbvOLxbZwWZvZ5COnpMetAs iqfw== X-Gm-Message-State: AHPjjUjMmwf/0sNNS4+izHFHqkdUS6xse7VZvjKIEHJ1JrqWhso6ACPj IzGITHpFGosoNCj/MNo= X-Received: by 10.129.175.103 with SMTP id x39mr2691330ywj.226.1504882458581; Fri, 08 Sep 2017 07:54:18 -0700 (PDT) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com. [209.85.214.52]) by smtp.gmail.com with ESMTPSA id y7sm746592ywg.36.2017.09.08.07.54.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 07:54:18 -0700 (PDT) Received: by mail-it0-f52.google.com with SMTP id c195so2871084itb.1 for ; Fri, 08 Sep 2017 07:54:18 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD40IyzQC36FaNa3YbNGh+/JLPTT/5KEuYGyEMKuGsQdnyXDhsYGCy/EEacBc3jKXLBgms2aPYwF2yKPJ4SHh4= X-Received: by 10.36.17.85 with SMTP id 82mr1274731itf.78.1504882457856; Fri, 08 Sep 2017 07:54:17 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Fri, 8 Sep 2017 07:54:17 -0700 (PDT) In-Reply-To: <87lglp6zj8.fsf@vostro.rath.org> 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> From: Conrad Meyer Date: Fri, 8 Sep 2017 07:54:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: umount() taking minutes for FUSE filesystems To: freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" 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 14:54:26 -0000 On Fri, Sep 8, 2017 at 7:22 AM, Nikolaus Rath wrote: > In most cases, umount() is not called by the filesystem but by the > user. In that case, the FUSE_DESTROY request gives the filesystem a > chance to clean-up and exit the main loop. > > That said, the filesystem could also detect the unmount by the kernel > closing the fd. So I'm not sure what is gained by the extra request > either... Theoretically, at least under Linux the destroy handler could > perform some notify_* operations, but I don't see how that would be > useful when the filesystem will be unmounted anyway. Hi Nikolaus, It seems like the destroy notification is a good chance for the filesystem to flush any dirty buffers before umount completes. Sure, the filesystem could just do that when it detects the kernel has closed the fd, but then there is no guarantee it happens during umount. It seems that it should happen during umount for logical correctness. Best, Conrad