From: Daniil Lunev <dlunev@chromium.org>
To: linux-fsdevel@vger.kernel.org
Cc: fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
Daniil Lunev <dlunev@chromium.org>,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH 1/2] fs/super: Add a flag to mark super block defunc
Date: Wed, 11 May 2022 11:30:56 +1000 [thread overview]
Message-ID: <20220511113050.1.Ifc059f4eca1cce3e2cc79818467c94f65e3d8dde@changeid> (raw)
In-Reply-To: <20220511013057.245827-1-dlunev@chromium.org>
File system can mark a block "defunc" in order to prevent matching
against it in a new mount.
Signed-off-by: Daniil Lunev <dlunev@chromium.org>
---
fs/super.c | 4 ++--
include/linux/fs.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..fc5b3efe0cd01 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1216,7 +1216,7 @@ static int set_bdev_super_fc(struct super_block *s, struct fs_context *fc)
static int test_bdev_super_fc(struct super_block *s, struct fs_context *fc)
{
- return s->s_bdev == fc->sget_key;
+ return !s->s_defunc && s->s_bdev == fc->sget_key;
}
/**
@@ -1307,7 +1307,7 @@ EXPORT_SYMBOL(get_tree_bdev);
static int test_bdev_super(struct super_block *s, void *data)
{
- return (void *)s->s_bdev == data;
+ return !s->s_defunc && (void *)s->s_bdev == data;
}
struct dentry *mount_bdev(struct file_system_type *fs_type,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index bbde95387a23a..76feb3fe9bb9e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1448,6 +1448,7 @@ struct super_block {
struct rw_semaphore s_umount;
int s_count;
atomic_t s_active;
+ bool s_defunc;
#ifdef CONFIG_SECURITY
void *s_security;
#endif
--
2.31.0
next prev parent reply other threads:[~2022-05-11 1:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 1:30 [PATCH 0/2] Prevent re-use of FUSE superblock after force unmount Daniil Lunev
2022-05-11 1:30 ` Daniil Lunev [this message]
2022-05-11 14:50 ` [PATCH 1/2] fs/super: Add a flag to mark super block defunc Theodore Ts'o
2022-05-11 14:54 ` Christoph Hellwig
2022-05-11 21:33 ` Daniil Lunev
2022-05-11 1:30 ` [PATCH 2/2] FUSE: Mark super block defunc on force unmount Daniil Lunev
2022-05-11 7:07 ` [PATCH 0/2] Prevent re-use of FUSE superblock after " Miklos Szeredi
2022-05-11 7:36 ` Daniil Lunev
2022-05-11 7:54 ` Miklos Szeredi
2022-05-11 9:37 ` Daniil Lunev
2022-05-11 10:34 ` Miklos Szeredi
2022-05-11 11:19 ` Daniil Lunev
2022-05-11 11:38 ` Bernd Schubert
2022-05-11 12:28 ` Miklos Szeredi
2022-05-11 13:05 ` Daniil Lunev
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=20220511113050.1.Ifc059f4eca1cce3e2cc79818467c94f65e3d8dde@changeid \
--to=dlunev@chromium.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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®