Return-Path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52625 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1948830AbdEZXLI (ORCPT ); Fri, 26 May 2017 19:11:08 -0400 From: Nikolaus Rath To: fuse-devel@lists.sourceforge.net, linux-fsdevel Subject: Re: fuse: when are release requests queued? References: <87a860r0v9.fsf@thinkpad.rath.org> Date: Fri, 26 May 2017 16:11:05 -0700 In-Reply-To: (David Butterfield's message of "Fri, 26 May 2017 09:17:51 -0600") Message-ID: <87o9ufp62e.fsf@vostro.rath.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On May 26 2017, David Butterfield wrote: >> Looking at fs/fuse/file.c, it looks as if fuse_release() directly calls >> fuse_request_send_background() to send the request. But at that point I >> can no longer follow the code. Is it possible for another request to >> sneak in at this point? >> >> Furthermore, does the VFS call fuse_release() directly while handling >> the close() syscall, or does this happen asynchronously later on? > > Does the comment in fuse_release_common (called by fuse_release) > (Linux 4.4.0) answer this? > > 267 /* > 268 * Normally this will send the RELEASE request, however if > 269 * some asynchronous READ or WRITE requests are outstanding, > 270 * the sending will be delayed. > 271 * > 272 * Make the release synchronous if this is a fuseblk mount, > 273 * synchronous RELEASE is allowed (and desirable) in this ca= se > 274 * because the server can be trusted not to screw up. > 275 */ It does give some indication, I'd rather have someone familiar with the actual code confirm this. Specifically, this says that if async read()/write() requests are pending, the RELEASE will be delayed. But does this guarantee that that if there are no pending requests it will not be delayed? And how can there be a pending request if the file isn't open anymore? 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