summaryrefslogtreecommitdiffstats
path: root/fs/ext4/mmp.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2015-10-17 16:16:04 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-10-17 16:16:04 -0400
commit6a797d2737838906f2ea0a31686e87c3151e21ca (patch)
treec13f506c771271660fb76d3e0ba86a9e107f0ed9 /fs/ext4/mmp.c
parent8c81bd8f586c46eaf114758a78d82895a2b081c2 (diff)
downloadlinux-stable-6a797d2737838906f2ea0a31686e87c3151e21ca.tar.gz
linux-stable-6a797d2737838906f2ea0a31686e87c3151e21ca.tar.bz2
linux-stable-6a797d2737838906f2ea0a31686e87c3151e21ca.zip
ext4: call out CRC and corruption errors with specific error codes
Instead of overloading EIO for CRC errors and corrupt structures, return the same error codes that XFS returns for the same issues. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mmp.c')
-rw-r--r--fs/ext4/mmp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 6eb1a619890c..0a512aa81bf7 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -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",