linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: Maxim Patlasov <mpatlasov@virtuozzo.com>
Cc: "fuse-devel\@lists.sourceforge.net"
	<fuse-devel@lists.sourceforge.net>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [fuse-devel] fuse: when are release requests queued?
Date: Wed, 31 May 2017 13:31:08 -0700	[thread overview]
Message-ID: <87fufkvkdv.fsf@thinkpad.rath.org> (raw)
In-Reply-To: <0ad44a48-5b0f-ee1d-ccdf-f617378c07e6@virtuozzo.com> (Maxim Patlasov's message of "Wed, 31 May 2017 13:23:13 -0700")

On May 31 2017, Maxim Patlasov <mpatlasov@virtuozzo.com> wrote:
>> I do not fully understand the difference you describe. What I would like
>> to construct is the following scenario:
>>
>> 1. Userspace calls close()
>> 2. Userspace close() returns
>> 3. Userspace calls unlink()
>> 4. Userspace unlink() returns
>> 5. libfuse reads UNLINK request from kernel pipe
>> 6. libfuse reads RELEASE request from kernel pipe
>>
>> What would be the simplest way to do that?
>
> I would try to keep fc->active_background elevated somehow. For
> example you add sleep(1) for every incoming write request to libfuse
> and serialize processing them. Then you generate enough writes to
> achieve fc->max_background. If you call close() now, and if it really
> ends up in last __fput(), corresponding FUSE_RELEASE will sit in
> background queue for long while (as many seconds as # elements in the
> queue). But close() from your 2. will return much earlier because it
> doesn't wait for completion of FUSE_RELEASE. Hence unlink() might
> succeed.

Ah, got it now, thanks!

Wouldn't be a simpler solution be to just patch the kernel module to
*always* put FUSE_RELEASE requests into the background queue, so that I
don't have to manually keep fc->active_background elevated?

I just can't seem to find the code that does this check... I would
expect it in fuse_file_put(), but the condition in there does not seem to
look at the number of background requests at all.


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

  reply	other threads:[~2017-05-31 20:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 23:08 fuse: when are release requests queued? Nikolaus Rath
2017-05-26 15:17 ` [fuse-devel] " David Butterfield
2017-05-26 23:11   ` Nikolaus Rath
2017-05-27  1:49     ` [fuse-devel] " Maxim Patlasov
2017-05-27  1:39 ` Maxim Patlasov
2017-05-29 16:49   ` Nikolaus Rath
2017-05-31 17:50     ` Maxim Patlasov
2017-05-31 19:19       ` Nikolaus Rath
2017-05-31 19:32         ` Maxim Patlasov
2017-05-31 19:41           ` Nikolaus Rath
     [not found]             ` <87inkgvmp0.fsf-Zv899e0YUSYPWKMTL/zdXNi2O/JbrIOy@public.gmane.org>
2017-05-31 19:51               ` Michael Theall
2017-05-31 20:34                 ` Nikolaus Rath
2017-05-31 20:23             ` [fuse-devel] " Maxim Patlasov
2017-05-31 20:31               ` Nikolaus Rath [this message]
2017-05-31 20:47                 ` Maxim Patlasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fufkvkdv.fsf@thinkpad.rath.org \
    --to=nikolaus@rath.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mpatlasov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).