From: Bernd Schubert <bschubert@ddn.com>
To: Aleksandr Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Cc: "mszeredi@redhat.com" <mszeredi@redhat.com>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Amir Goldstein" <amir73il@gmail.com>,
"Stéphane Graber" <stgraber@ubuntu.com>,
"Seth Forshee" <sforshee@kernel.org>,
"Christian Brauner" <brauner@kernel.org>,
"Andrei Vagin" <avagin@gmail.com>,
"Pavel Tikhomirov" <ptikhomirov@virtuozzo.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"criu@openvz.org" <criu@openvz.org>
Subject: Re: [RFC PATCH 7/9] fuse: add fuse device ioctl(FUSE_DEV_IOC_REINIT)
Date: Tue, 11 Apr 2023 22:18:11 +0000 [thread overview]
Message-ID: <4632a71e-8f15-66ad-3193-4605a1204f8d@ddn.com> (raw)
In-Reply-To: <CAEivzxdjjJmwPaxe5miWPxun_ZCRt-wjuCCA2nzOWWyzZZUuOg@mail.gmail.com>
On 4/3/23 16:51, Aleksandr Mikhalitsyn wrote:
> On Mon, Mar 6, 2023 at 3:09 PM Aleksandr Mikhalitsyn
> <aleksandr.mikhalitsyn@canonical.com> wrote:
>>
>> On Fri, Mar 3, 2023 at 8:26 PM Bernd Schubert
>> <bernd.schubert@fastmail.fm> wrote:
>>>
>>>
>>>
>>> On 2/20/23 20:37, Alexander Mikhalitsyn wrote:
>>>> This ioctl aborts fuse connection and then reinitializes it,
>>>> sends FUSE_INIT request to allow a new userspace daemon
>>>> to pick up the fuse connection.
>>>>
>>>> Cc: Miklos Szeredi <mszeredi@redhat.com>
>>>> Cc: Al Viro <viro@zeniv.linux.org.uk>
>>>> Cc: Amir Goldstein <amir73il@gmail.com>
>>>> Cc: Stéphane Graber <stgraber@ubuntu.com>
>>>> Cc: Seth Forshee <sforshee@kernel.org>
>>>> Cc: Christian Brauner <brauner@kernel.org>
>>>> Cc: Andrei Vagin <avagin@gmail.com>
>>>> Cc: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
>>>> Cc: linux-fsdevel@vger.kernel.org
>>>> Cc: linux-kernel@vger.kernel.org
>>>> Cc: criu@openvz.org
>>>> Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
>>>> ---
>>>> fs/fuse/dev.c | 132 ++++++++++++++++++++++++++++++++++++++
>>>> include/uapi/linux/fuse.h | 1 +
>>>> 2 files changed, 133 insertions(+)
>>>>
>>>> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
>>>> index 737764c2295e..0f53ffd63957 100644
>>>> --- a/fs/fuse/dev.c
>>>> +++ b/fs/fuse/dev.c
>>>> @@ -2187,6 +2187,112 @@ void fuse_abort_conn(struct fuse_conn *fc)
>>>> }
>>>> EXPORT_SYMBOL_GPL(fuse_abort_conn);
>>>>
>>>> +static int fuse_reinit_conn(struct fuse_conn *fc)
>>>> +{
>>>> + struct fuse_iqueue *fiq = &fc->iq;
>>>> + struct fuse_dev *fud;
>>>> + unsigned int i;
>>>> +
>>>> + if (fc->conn_gen + 1 < fc->conn_gen)
>>>> + return -EOVERFLOW;
>>>> +
>>>> + fuse_abort_conn(fc);
>>>> + fuse_wait_aborted(fc);
>>>
>>> Shouldn't this also try to flush all data first?
>
> Dear Bernd,
>
> I've reviewed this place 2nd time and I'm not sure that we have to
> perform any flushing there, because userspace daemon can be dead or
> stuck.
> Technically, if userspace knows that daemon is alive then it can call
> fsync/sync before doing reinit.
>
> What do you think about it?
Hello Alex,
sorry for my late reply.
Hmm, I just fear that fsync/sync is a bit racy, what is if a user would
write data after the sync and that would get silently removed by
fuse_abort_conn()? Isn't what we want:
ioctl
refuse new requests -> unset fc->initialized
flush all fc queues (fc->iq.pending, fc->bg_queue, I guess with your
current patches we do not need to handle forget)
fuse_abort_conn
So what is missing is the information if the daemon is still running -
take a daemon reference and then check for PF_EXITING, as in my uring
patches? Miklos has some objections for that, though.
The alternative would be to mount read-only, then sync, then do the
ioctl and remount back. I don't know what needs to be done to get
remount working, though. Just handle it in libfuse mount.fuse and send
the mount syscall?
As I wrote before, at DDN we want to have run time daemon restart - I'm
also not opposed to entirely give up on the flush and to just work on a
restart protocol to make the new daemon to the old state (opened files
and lookup/forget count). In principle we could even transfer that in
userspace from one daemon to the other?
Thanks,
Bernd
PS: Will look at the new patches later this week.
Thanks,
Bernd
next prev parent reply other threads:[~2023-04-11 22:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 19:37 [RFC PATCH 0/9] fuse: API for Checkpoint/Restore Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 1/9] fuse: move FUSE_DEFAULT_* defines to fuse common header Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 2/9] fuse: add const qualifiers to common fuse helpers Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 3/9] fuse: add fuse connection generation Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 4/9] fuse: handle stale inode connection in fuse_queue_forget Alexander Mikhalitsyn
2023-03-03 18:47 ` Bernd Schubert
2023-02-20 19:37 ` [RFC PATCH 5/9] fuse: move fuse connection flags to the separate structure Alexander Mikhalitsyn
2023-03-03 18:26 ` Bernd Schubert
2023-02-20 19:37 ` [RFC PATCH 6/9] fuse: take fuse connection generation into account Alexander Mikhalitsyn
2023-03-03 18:45 ` Bernd Schubert
2023-02-20 19:37 ` [RFC PATCH 7/9] fuse: add fuse device ioctl(FUSE_DEV_IOC_REINIT) Alexander Mikhalitsyn
2023-03-03 19:19 ` Bernd Schubert
2023-04-03 14:56 ` Aleksandr Mikhalitsyn
2023-03-03 19:26 ` Bernd Schubert
2023-03-06 14:09 ` Aleksandr Mikhalitsyn
2023-04-03 14:51 ` Aleksandr Mikhalitsyn
2023-04-11 22:18 ` Bernd Schubert [this message]
2023-02-20 19:37 ` [RFC PATCH 8/9] namespace: add sb_revalidate_bindmounts helper Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 9/9] fuse: add fuse device ioctl(FUSE_DEV_IOC_BM_REVAL) Alexander Mikhalitsyn
2023-03-03 19:42 ` [RFC PATCH 0/9] fuse: API for Checkpoint/Restore Bernd Schubert
2023-03-06 14:06 ` Aleksandr Mikhalitsyn
2023-03-06 16:14 ` Miklos Szeredi
2023-03-06 16:44 ` Aleksandr Mikhalitsyn
2023-03-06 19:18 ` Miklos Szeredi
2023-03-06 21:05 ` Bernd Schubert
2023-03-06 22:16 ` Aleksandr Mikhalitsyn
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=4632a71e-8f15-66ad-3193-4605a1204f8d@ddn.com \
--to=bschubert@ddn.com \
--cc=aleksandr.mikhalitsyn@canonical.com \
--cc=amir73il@gmail.com \
--cc=avagin@gmail.com \
--cc=brauner@kernel.org \
--cc=criu@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=ptikhomirov@virtuozzo.com \
--cc=sforshee@kernel.org \
--cc=stgraber@ubuntu.com \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®