]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: fix bdev write error check failed when mount fs with ro
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Mon, 28 Sep 2020 02:05:56 +0000 (22:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:51:52 +0000 (11:51 +0100)
commit5c2af83a89726af30644c2d7dd90df2ef993ae4a
tree0ada91e28c558669c283fbd663f841d7f5521319
parente500902cd5b88fd805d2c206bcce4f9782cc8cd4
ext4: fix bdev write error check failed when mount fs with ro

commit 9704a322ea67fdb05fc66cf431fdd01c2424bbd9 upstream.

Consider a situation when a filesystem was uncleanly shutdown and the
orphan list is not empty and a read-only mount is attempted. The orphan
list cleanup during mount will fail with:

ext4_check_bdev_write_error:193: comm mount: Error while async write back metadata

This happens because sbi->s_bdev_wb_err is not initialized when mounting
the filesystem in read only mode and so ext4_check_bdev_write_error()
falsely triggers.

Initialize sbi->s_bdev_wb_err unconditionally to avoid this problem.

Fixes: bc71726c7257 ("ext4: abort the filesystem if failed to async write metadata buffer")
Cc: stable@kernel.org
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200928020556.710971-1-zhangxiaoxu5@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/super.c