From: Jeff Layton <jlayton@kernel.org>
To: Joanne Koong <joannelkoong@gmail.com>,
miklos@szeredi.hu, linux-fsdevel@vger.kernel.org
Cc: josef@toxicpanda.com, bernd.schubert@fastmail.fm,
jefflexu@linux.alibaba.com, laoar.shao@gmail.com,
senozhatsky@chromium.org, tfiga@chromium.org, bgeffon@google.com,
etmartin4313@gmail.com, kernel-team@meta.com
Subject: Re: [PATCH v11 1/2] fuse: add kernel-enforced timeout option for requests
Date: Thu, 19 Dec 2024 09:06:56 -0500 [thread overview]
Message-ID: <c0cd07304073c0860a47905c2598a5a22df52c3d.camel@kernel.org> (raw)
In-Reply-To: <4ab1f4dee6e15787ecdc304ce9e46bef06b9dffa.camel@kernel.org>
On Thu, 2024-12-19 at 07:19 -0500, Jeff Layton wrote:
> On Wed, 2024-12-18 at 14:26 -0800, Joanne Koong wrote:
> > There are situations where fuse servers can become unresponsive or
> > stuck, for example if the server is deadlocked. Currently, there's no
> > good way to detect if a server is stuck and needs to be killed manually.
> >
> > This commit adds an option for enforcing a timeout (in seconds) for
> > requests where if the timeout elapses without the server responding to
> > the request, the connection will be automatically aborted.
> >
> > Please note that these timeouts are not 100% precise. For example, the
> > request may take roughly an extra FUSE_TIMEOUT_TIMER_FREQ seconds beyond
> > the requested timeout due to internal implementation, in order to
> > mitigate overhead.
> >
> > Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> > ---
> > fs/fuse/dev.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++
> > fs/fuse/fuse_i.h | 22 +++++++++++++
> > fs/fuse/inode.c | 23 +++++++++++++
> > 3 files changed, 130 insertions(+)
> >
> > diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> > index 27ccae63495d..bcf8a7994944 100644
> > --- a/fs/fuse/dev.c
> > +++ b/fs/fuse/dev.c
> > @@ -45,6 +45,87 @@ static struct fuse_dev *fuse_get_dev(struct file *file)
> > return READ_ONCE(file->private_data);
> > }
> >
> > +static bool request_expired(struct fuse_conn *fc, struct list_head *list)
> > +{
> > + struct fuse_req *req;
> > +
> > + req = list_first_entry_or_null(list, struct fuse_req, list);
> > + if (!req)
> > + return false;
> > + return time_is_before_jiffies(req->create_time + fc->timeout.req_timeout);
> > +}
>
> Shouldn't that be time_is_after_jiffies() ? This is going to return
> true when you've not yet hit the timeout, no?
>
My mistake, I misinterpreted the time_is_before_jiffies() macro. You
can add:
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2024-12-19 14:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 22:26 [PATCH v11 0/2] fuse: add kernel-enforced request timeout option Joanne Koong
2024-12-18 22:26 ` [PATCH v11 1/2] fuse: add kernel-enforced timeout option for requests Joanne Koong
2024-12-19 12:19 ` Jeff Layton
2024-12-19 14:06 ` Jeff Layton [this message]
2024-12-19 20:44 ` Etienne Martineau
2024-12-26 1:51 ` Sergey Senozhatsky
2024-12-18 22:26 ` [PATCH v11 2/2] fuse: add default_request_timeout and max_request_timeout sysctls Joanne Koong
2024-12-26 1:52 ` Sergey Senozhatsky
2025-01-15 19:41 ` [PATCH v11 0/2] fuse: add kernel-enforced request timeout option Joanne Koong
2025-01-16 12:11 ` Miklos Szeredi
2025-01-16 20:01 ` Joanne Koong
2025-01-17 1:40 ` Jingbo Xu
2025-01-17 19:05 ` Joanne Koong
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=c0cd07304073c0860a47905c2598a5a22df52c3d.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=bernd.schubert@fastmail.fm \
--cc=bgeffon@google.com \
--cc=etmartin4313@gmail.com \
--cc=jefflexu@linux.alibaba.com \
--cc=joannelkoong@gmail.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@meta.com \
--cc=laoar.shao@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=senozhatsky@chromium.org \
--cc=tfiga@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox