ext4: fix error code in ext4_commit_super
PATCH v2 1/1 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 c4be0c1dc4cdc ("filesystem freeze: add error handling of write_super_lockfs/unlockfs").
Signed-off-by Fengnan Chang <[email protected]>
--- fs/ext4/super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/ext4/super.c +4 -2
@@ -5500,8 +5500,10 @@ static int ext4_commit_super(struct super_block *sb, int sync)struct buffer_head *sbh =EXT4_SB (sb)->s_sbh;int error =0 ; -if (!sbh ||block_device_ejected (sb)) -return error; +if (!sbh) +return -EINVAL ; +if (block_device_ejected (sb)) +return -ENODEV ;/* * If the file system is mounted read-only, don't update the
--
2.29.0
Quoted 6 lines · Fengnan Chang
We should set the error code when
ext4_commit_supercheck argument failed. Found in code review.Fixes c4be0c1dc4cdc ("filesystem freeze: add error handling of write_super_lockfs/unlockfs").Signed-off-by Fengnan Chang <[email protected]>
Reviewed-by Andreas Dilger <[email protected]>
Quoted 22 lines
---
fs/ext4/super.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)fs/ext4/super.c +4
-3@@ -5500,8 +5500,10 @@ static int ext4_commit_super(struct super_block *sb, int sync)struct buffer_head *sbh =EXT4_SB (sb)->s_sbh;int error =0 ; -if (!sbh ||block_device_ejected (sb)) -return error; +if (!sbh) +return -EINVAL ; +if (block_device_ejected (sb)) +return -ENODEV ;/* * If the file system is mounted read-only, don't update the --
Quoted 2 lines
2.29.0
Cheers, Andreas
Quoted 9 lines · Andreas Dilger
Quoted 6 lines · Fengnan Chang
We should set the error code when
ext4_commit_supercheck argument failed. Found in code review.Fixes c4be0c1dc4cdc ("filesystem freeze: add error handling of write_super_lockfs/unlockfs").Signed-off-by Fengnan Chang <[email protected]>Reviewed-by Andreas Dilger <[email protected]>
Thanks, applied.
- Ted