Commit 6f5fc7de authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Christian Brauner

ext4: drop s_umount over opening the log device

Just like get_tree_bdev needs to drop s_umount when opening the main
device, we need to do the same for the ext4 log device to avoid a
potential lock order reversal with s_unmount for the mark_dead path.

It might be preferable to just drop s_umount over ->fill_super entirely,
but that will require a fairly massive audit first, so we'll do the easy
version here first.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarTheodore Ts'o <tytso@mit.edu>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
Message-Id: <20230802154131.2221419-10-hch@lst.de>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 7ecd0b6f
......@@ -5842,7 +5842,10 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
if (WARN_ON_ONCE(!ext4_has_feature_journal(sb)))
return NULL;
/* see get_tree_bdev why this is needed and safe */
up_write(&sb->s_umount);
bdev = ext4_blkdev_get(j_dev, sb);
down_write(&sb->s_umount);
if (bdev == NULL)
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment