All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Kirill Smelkov <kirr@nexedi.com>
Cc: Miklos Szeredi <mszeredi@redhat.com>,
	linux-fsdevel@vger.kernel.org,
	fuse-devel <fuse-devel@lists.sourceforge.net>,
	Han-Wen Nienhuys <hanwen@google.com>,
	Jakob Unterwurzacher <jakobunt@gmail.com>,
	stable <stable@vger.kernel.org>
Subject: Re: [RESEND, PATCH v2] fuse: Don't drop NOTIFY_REPLY if we promised it
Date: Tue, 26 Feb 2019 16:14:22 +0100	[thread overview]
Message-ID: <CAJfpegtgNb2FpE=gHSVTmX5EWRJtDp-a5HZO2VS2_eHjPpp=fw@mail.gmail.com> (raw)
In-Reply-To: <20190219094147.32734-1-kirr@nexedi.com>

On Tue, Feb 19, 2019 at 10:42 AM Kirill Smelkov <kirr@nexedi.com> wrote:
>
> A successful call to NOTIFY_RETRIEVE by filesystem carries promise from
> the kernel to send back NOTIFY_REPLY message. However if the filesystem
> is not reading requests with fuse_conn->max_pages capacity,

That's a violation of the contract by the fuse server, not the kernel.

> fuse_dev_do_read might see that the "request is too large" and decide to
> "reply with an error and restart the read". "Reply with an error" has
> underlying assumption that there is a "requester thread" that is waiting
> for request completion, which is true for most requests, but is not true
> for NOTIFY_REPLY: NOTIFY_RETRIEVE handler completes with OK status right
> after it could successfully queue NOTIFY_REPLY message without waiting
> for NOTIFY_REPLY completion. This leads to situation when filesystem
> requested to retrieve inode data with NOTIFY_RETRIEVE, got err=OK for
> that notification request, but NOTIFY_REPLY is not coming back.
>
> More, since there is no "requester thread" to handle the error, the
> situation shows itself as /sys/fs/fuse/connections/X/waiting=1 _and_
> /dev/fuse read(s) queued. Which is misleading since NOTIFY_REPLY request
> was removed from pending queue and abandoned.

Now I don't understand how that would happen.   If the request is
abandoned, its refcount should go down to zero and the num_waiting
count decremented accordingly.

Thanks,
Miklos

  reply	other threads:[~2019-02-26 15:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19  9:42 [RESEND, PATCH v2] fuse: Don't drop NOTIFY_REPLY if we promised it Kirill Smelkov
2019-02-19  9:42 ` Kirill Smelkov
2019-02-26 15:14 ` Miklos Szeredi [this message]
2019-02-27 20:02   ` Kirill Smelkov
2019-02-27 20:02     ` Kirill Smelkov
2019-02-27 20:26     ` Miklos Szeredi
2019-02-27 20:39       ` Kirill Smelkov
2019-02-28  8:10         ` Miklos Szeredi
2019-02-28 11:48           ` Kirill Smelkov
2019-02-28 11:48             ` Kirill Smelkov
2019-02-28 11:50             ` [PATCH 2/2] fuse: require /dev/fuse reads to have enough buffer capacity as negotiated Kirill Smelkov
2019-03-07  9:34             ` [RESEND, PATCH v2] fuse: Don't drop NOTIFY_REPLY if we promised it Kirill Smelkov
2019-03-14 10:45               ` [RESEND3, PATCH 0/2] fuse: don't stuck clients on retrieve_notify with size > max_write Kirill Smelkov
2019-03-14 10:46                 ` [PATCH 1/2] fuse: retrieve: cap requested size to negotiated max_write Kirill Smelkov
2019-03-14 10:46                 ` [PATCH 2/2] fuse: require /dev/fuse reads to have enough buffer capacity as negotiated Kirill Smelkov

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='CAJfpegtgNb2FpE=gHSVTmX5EWRJtDp-a5HZO2VS2_eHjPpp=fw@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=hanwen@google.com \
    --cc=jakobunt@gmail.com \
    --cc=kirr@nexedi.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.