From: Daniil Lunev <dlunev@chromium.org>
To: linux-fsdevel@vger.kernel.org, miklos@szeredi.hu,
viro@zeniv.linux.org.uk, hch@infradead.org, tytso@mit.edu
Cc: fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
Daniil Lunev <dlunev@chromium.org>
Subject: [PATCH v3 2/2] FUSE: Retire superblock on force unmount
Date: Mon, 30 May 2022 11:39:58 +1000 [thread overview]
Message-ID: <20220530113953.v3.2.I692165059274c30b59bed56940b54a573ccb46e4@changeid> (raw)
In-Reply-To: <20220530013958.577941-1-dlunev@chromium.org>
Force unmount of FUSE severes the connection with the user space, even
if there are still open files. Subsequent remount tries to re-use the
superblock held by the open files, which is meaningless in the FUSE case
after disconnect - reused super block doesn't have userspace counterpart
attached to it and is incapable of doing any IO.
Signed-off-by: Daniil Lunev <dlunev@chromium.org>
---
Changes in v3:
- No changes
Changes in v2:
- Use an exported function instead of directly modifying superblock
fs/fuse/inode.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 8c0665c5dff88..8875361544b2a 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -476,8 +476,11 @@ static void fuse_umount_begin(struct super_block *sb)
{
struct fuse_conn *fc = get_fuse_conn_super(sb);
- if (!fc->no_force_umount)
- fuse_abort_conn(fc);
+ if (fc->no_force_umount)
+ return;
+
+ fuse_abort_conn(fc);
+ retire_super(sb);
}
static void fuse_send_destroy(struct fuse_mount *fm)
--
2.31.0
prev parent reply other threads:[~2022-05-30 1:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-30 1:39 [PATCH v3 0/2] Prevent re-use of FUSE superblock after force unmount Daniil Lunev
2022-05-30 1:39 ` [PATCH v3 1/2] fs/super: function to prevent super re-use Daniil Lunev
2022-05-31 7:24 ` Christoph Hellwig
2022-06-01 1:11 ` Daniil Lunev
2022-05-30 1:39 ` Daniil Lunev [this message]
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=20220530113953.v3.2.I692165059274c30b59bed56940b54a573ccb46e4@changeid \
--to=dlunev@chromium.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=tytso@mit.edu \
--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;
as well as URLs for NNTP newsgroup(s).