Skip to content

Commit f88f146

Browse files
Fengnan Changtytso
authored andcommitted
ext4: fix error code in ext4_commit_super
We should set the error code when ext4_commit_super check argument failed. Found in code review. Fixes: c4be0c1 ("filesystem freeze: add error handling of write_super_lockfs/unlockfs"). Cc: [email protected] Signed-off-by: Fengnan Chang <[email protected]> Reviewed-by: Andreas Dilger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent ac2f7ca commit f88f146

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/ext4/super.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5585,8 +5585,10 @@ static int ext4_commit_super(struct super_block *sb)
55855585
struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
55865586
int error = 0;
55875587

5588-
if (!sbh || block_device_ejected(sb))
5589-
return error;
5588+
if (!sbh)
5589+
return -EINVAL;
5590+
if (block_device_ejected(sb))
5591+
return -ENODEV;
55905592

55915593
ext4_update_super(sb);
55925594

0 commit comments

Comments
 (0)