diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2015-10-17 16:16:04 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-10-17 16:16:04 -0400 |
commit | 6a797d2737838906f2ea0a31686e87c3151e21ca (patch) | |
tree | c13f506c771271660fb76d3e0ba86a9e107f0ed9 /fs/ext4/super.c | |
parent | 8c81bd8f586c46eaf114758a78d82895a2b081c2 (diff) | |
download | op-kernel-dev-6a797d2737838906f2ea0a31686e87c3151e21ca.zip op-kernel-dev-6a797d2737838906f2ea0a31686e87c3151e21ca.tar.gz |
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/super.c')
-rw-r--r-- | fs/ext4/super.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 43c0cc8..f7519ad 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -490,6 +490,12 @@ const char *ext4_decode_error(struct super_block *sb, int errno, char *errstr = NULL; switch (errno) { + case -EFSCORRUPTED: + errstr = "Corrupt filesystem"; + break; + case -EFSBADCRC: + errstr = "Filesystem failed CRC"; + break; case -EIO: errstr = "IO failure"; break; @@ -3192,6 +3198,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ext4_msg(sb, KERN_ERR, "VFS: Found ext4 filesystem with " "invalid superblock checksum. Run e2fsck?"); silent = 1; + ret = -EFSBADCRC; goto cantfind_ext4; } @@ -3612,6 +3619,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } if (!ext4_check_descriptors(sb, &first_not_zeroed)) { ext4_msg(sb, KERN_ERR, "group descriptors corrupted!"); + ret = -EFSCORRUPTED; goto failed_mount2; } @@ -4664,7 +4672,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) "ext4_remount: Checksum for group %u failed (%u!=%u)", g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)), le16_to_cpu(gdp->bg_checksum)); - err = -EINVAL; + err = -EFSBADCRC; goto restore_opts; } } |