Skip to contentSkip to conversation

ext4: Fix ext4_error_err save negative errno into superblock

PATCH Superseded Ye Bin 2 participants 2 messages Apr 1, 2021 – Apr 2, 2021 ext4 file system

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ye Bin

author
#0 lore raw

PATCH v2 1/1 ext4: Fix ext4_error_err save negative errno into superblock

As read_mmp_block return 1 when failed. read_mmp_block return -EIO when buffer isn't uptodate.

Fixes 54d3adbc29f0 ("ext4: save all error info in save_error_info() and

drop ext4_set_errno()")

---
 fs/ext4/mmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/mmp.c +1 -1
index 795c3ff2907c..68fbeedd627b 100644
@@ -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;
 }
Signature · 1 line
2.25.4
#1 lore raw
Quoted 3 lines · Ye Bin

As read_mmp_block return 1 when failed. read_mmp_block return -EIO when buffer isn't uptodate.

Thank you for this second patch. Unfortunately, the commit message is still confusing/incorrect because it references read_mmp_block() in the first usage but is actually changing write_mmp_block().

With that change you could add a Reviewed-by label from me.

Cheers, Andreas

Quoted 22 lines
Fixes 54d3adbc29f0 ("ext4: save all error info in save_error_info() and

drop ext4_set_errno()")

---
fs/ext4/mmp.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/mmp.c +1 -2
index 795c3ff2907c..68fbeedd627b 100644
@@ -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;
 }
--
Quoted 2 lines

2.25.4

Cheers, Andreas