aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2010-11-19 09:56:44 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-11-19 09:56:44 -0500
commit5a9ae68a349aa076bc8557ee2fcf865574459282 (patch)
tree484c26f74f13a0c5962ac634c90462d98dea8e1a /fs/ext4/super.c
parent0587aa3d11f9769a301b21bff2c3ed8365606b8d (diff)
ext4: ext4_fill_super shouldn't return 0 on corruption
At the start of ext4_fill_super, ret is set to -EINVAL, and any failure path out of that function returns ret. However, the generic_check_addressable clause sets ret = 0 (if it passes), which means that a subsequent failure (e.g. a group checksum error) returns 0 even though the mount should fail. This causes vfs_kern_mount in turn to think that the mount succeeded, leading to an oops. A simple fix is to avoid using ret for the generic_check_addressable check, which was last changed in commit 30ca22c70e3ef0a96ff84de69cd7e8561b416cb2. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ef09d1443d1a..14ada8c50c43 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3265,13 +3265,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3265 * Test whether we have more sectors than will fit in sector_t, 3265 * Test whether we have more sectors than will fit in sector_t,
3266 * and whether the max offset is addressable by the page cache. 3266 * and whether the max offset is addressable by the page cache.
3267 */ 3267 */
3268 ret = generic_check_addressable(sb->s_blocksize_bits, 3268 err = generic_check_addressable(sb->s_blocksize_bits,
3269 ext4_blocks_count(es)); 3269 ext4_blocks_count(es));
3270 if (ret) { 3270 if (err) {
3271 ext4_msg(sb, KERN_ERR, "filesystem" 3271 ext4_msg(sb, KERN_ERR, "filesystem"
3272 " too large to mount safely on this system"); 3272 " too large to mount safely on this system");
3273 if (sizeof(sector_t) < 8) 3273 if (sizeof(sector_t) < 8)
3274 ext4_msg(sb, KERN_WARNING, "CONFIG_LBDAF not enabled"); 3274 ext4_msg(sb, KERN_WARNING, "CONFIG_LBDAF not enabled");
3275 ret = err;
3275 goto failed_mount; 3276 goto failed_mount;
3276 } 3277 }
3277 3278