ext4: fix ext4_error_err save negative errno into superblock
authorYe Bin <yebin10@huawei.com>
Tue, 6 Apr 2021 02:53:31 +0000 (10:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:38 +0000 (14:47 +0200)
commitbf4ba04f0161c8b17cfca9cd32118a6215593b30
tree5fe08f921317269e2c76d6c4e39aa329428a4ad2
parent12905cf9e5c418fe8ad45e56d8d79848c6b11558
ext4: fix ext4_error_err save negative errno into superblock

commit 6810fad956df9e5467e8e8a5ac66fda0836c71fa upstream.

Fix As write_mmp_block() so that it returns -EIO instead of 1, so that
the correct error gets saved into the superblock.

Cc: stable@kernel.org
Fixes: 54d3adbc29f0 ("ext4: save all error info in save_error_info() and drop ext4_set_errno()")
Reported-by: Liu Zhi Qiang <liuzhiqiang26@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20210406025331.148343-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/mmp.c