diff options
author | Christian Brauner <brauner@kernel.org> | 2024-03-26 13:47:22 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-03-27 13:17:15 +0100 |
commit | 22650a99821dda3d05f1c334ea90330b4982de56 (patch) | |
tree | d6dbade087df53eb660d654d876a35c6d1a59a54 /fs/romfs | |
parent | 3ff56e285de5a375fbfab3c3f1af81bbd23db36d (diff) |
fs,block: yield devices early
Currently a device is only really released once the umount returns to
userspace due to how file closing works. That ultimately could cause
an old umount assumption to be violated that concurrent umount and mount
don't fail. So an exclusively held device with a temporary holder should
be yielded before the filesystem is gone. Add a helper that allows
callers to do that. This also allows us to remove the two holder ops
that Linus wasn't excited about.
Link: https://lore.kernel.org/r/20240326-vfs-bdev-end_holder-v1-1-20af85202918@kernel.org
Fixes: f3a608827d1f ("bdev: open block device as files") # mainline only
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/romfs')
-rw-r--r-- | fs/romfs/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/romfs/super.c b/fs/romfs/super.c index 2be227532f39..2cbb92462074 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -594,7 +594,7 @@ static void romfs_kill_sb(struct super_block *sb) #ifdef CONFIG_ROMFS_ON_BLOCK if (sb->s_bdev) { sync_blockdev(sb->s_bdev); - fput(sb->s_bdev_file); + bdev_fput(sb->s_bdev_file); } #endif } |