]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: function to prevent re-use of block-device-based superblocks
authorDaniil Lunev <dlunev@chromium.org>
Wed, 27 Jul 2022 06:44:24 +0000 (16:44 +1000)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 27 Jul 2022 09:30:30 +0000 (11:30 +0200)
commit79008faff4fb178ef1ba52d41eb905378cf205eb
tree7a3cff2cee9ac275b7a3201a13f1c6d4c08e2a7a
parentb78174b1a78528418534f221aaba9d848844cdc4
vfs: function to prevent re-use of block-device-based superblocks

The function is to be called from filesystem-specific code to mark a
superblock to be ignored by superblock test and thus never re-used.  The
function also unregisters bdi if the bdi is per-superblock to avoid
collision if a new superblock is created to represent the filesystem.
generic_shutdown_super() skips unregistering bdi for a retired superlock as
it assumes retire function has already done it.

This patch adds the functionality only for the block-device-based supers,
since the primary use case of the feature is to gracefully handle force
unmount of external devices, mounted with FUSE.  This can be further
extended to cover all superblocks, if the need arises.

Signed-off-by: Daniil Lunev <dlunev@chromium.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/super.c
include/linux/fs.h