Thread (396 messages) 396 messages, 10 authors, 2021-05-11
STALE1901d REVIEWED: 1 (0M)

[PATCH 5.12 342/384] ext4: fix ext4_error_err save negative errno into superblock

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-05-10 12:49:11
Also in: lkml

From: Ye Bin <redacted>

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 <redacted>
Signed-off-by: Ye Bin <redacted>
Reviewed-by: Andreas Dilger <redacted>
Link: https://lore.kernel.org/r/20210406025331.148343-1-yebin10@huawei.com (local)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/ext4/mmp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -56,7 +56,7 @@ static int write_mmp_block(struct super_
 	wait_on_buffer(bh);
 	sb_end_write(sb);
 	if (unlikely(!buffer_uptodate(bh)))
-		return 1;
+		return -EIO;
 
 	return 0;
 }

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help