]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ext4/mmp.c
Merge remote-tracking branch 'l2-mtd/master'
[karo-tx-linux.git] / fs / ext4 / mmp.c
index 6eb1a619890c580786f92a71c342a2eed41be973..0a512aa81bf7505ab8803cc90191249f91cb4a27 100644 (file)
@@ -98,10 +98,12 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh,
        }
 
        mmp = (struct mmp_struct *)((*bh)->b_data);
-       if (le32_to_cpu(mmp->mmp_magic) == EXT4_MMP_MAGIC &&
-           ext4_mmp_csum_verify(sb, mmp))
+       if (le32_to_cpu(mmp->mmp_magic) != EXT4_MMP_MAGIC)
+               ret = -EFSCORRUPTED;
+       else if (!ext4_mmp_csum_verify(sb, mmp))
+               ret = -EFSBADCRC;
+       else
                return 0;
-       ret = -EINVAL;
 
 warn_exit:
        ext4_warning(sb, "Error %d while reading MMP block %llu",