mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
ext4: fix error code in ext4_commit_super
commit f88f1466e2a2e5ca17dfada436d3efa1b03a3972 upstream. 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"). Cc: stable@kernel.org Signed-off-by: Fengnan Chang <changfengnan@vivo.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Link: https://lore.kernel.org/r/20210402101631.561-1-changfengnan@vivo.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e70db6e432
commit
5a480aeb8b
@ -4859,8 +4859,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user