2021-04-06 12:59:07

by Ye Bin

[permalink] [raw]
Subject: [PATCH v3] ext4: Fix ext4_error_err save negative errno into superblock

As write_mmp_block return 1 when buffer isn't uptodate, return -EIO is
more appropriate.

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]>
Reviewed-by: Andreas Dilger <[email protected]>
---
fs/ext4/mmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 795c3ff2907c..68fbeedd627b 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -56,7 +56,7 @@ static int write_mmp_block(struct super_block *sb, struct buffer_head *bh)
wait_on_buffer(bh);
sb_end_write(sb);
if (unlikely(!buffer_uptodate(bh)))
- return 1;
+ return -EIO;

return 0;
}
--
2.25.4


2021-04-10 00:55:51

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH v3] ext4: Fix ext4_error_err save negative errno into superblock

On Tue, Apr 06, 2021 at 10:53:31AM +0800, Ye Bin wrote:
> As write_mmp_block return 1 when buffer isn't uptodate, return -EIO is
> more appropriate.
>
> 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]>
> Reviewed-by: Andreas Dilger <[email protected]>

Thanks, applied.

- Ted