ext4: Fix ext4_error_err save negative errno into superblock
PATCH 1/1 ext4: Fix ext4_error_err save negative errno into superblock
As read_mmp_block return 1 when failed, so just pass retval to save_error_info.
Fixes 54d3adbc29f0 ("ext4: save all error info in save_error_info() and
drop ext4_set_errno()")
Reported-by Liu Zhi Qiang <[email protected]>
Signed-off-by Ye Bin <[email protected]>
--- fs/ext4/mmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/mmp.c +1 -1
@@ -171,7 +171,7 @@ static int kmmpd(void *data)*/ if (retval) {if ((failed_writes %60 ) ==0 ) { -ext4_error_err (sb, -retval, +ext4_error_err (sb, retval,"Error writing to MMP block" ); } failed_writes++;
Signature · 1 line
2.25.4
Quoted 3 lines · Ye Bin
As
read_mmp_blockreturn 1 when failed, so just pass retval tosave_error_info.
Thank you for submitting this patch, but it should not be accepted.
The commit message is confusing, since the code being changed relates to retval from write_mmp_block(). That currently returns 1, but only until your next patch is applied.
I think it is better to fix write_mmp_block() as in your next patch to return a negative value to be more consistent with other code.
Cheers, Andreas
Quoted 22 lines
Fixes 54d3adbc29f0 ("ext4: save all error info in save_error_info() anddrop
ext4_set_errno()")Reported-by Liu Zhi Qiang <[email protected]>Signed-off-by Ye Bin <[email protected]>---
fs/ext4/mmp.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/ext4/mmp.c +1
-2@@ -171,7 +171,7 @@ static int kmmpd(void *data)*/ if (retval) {if ((failed_writes %60 ) ==0 ) { -ext4_error_err (sb, -retval, +ext4_error_err (sb, retval,"Error writing to MMP block" ); } failed_writes++; --
Quoted 2 lines
2.25.4
Cheers, Andreas