diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ae37a3c8fa69..0b364f5e6fdf 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5057,8 +5057,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