diff options
author | Eric Sandeen <sandeen@redhat.com> | 2012-05-28 14:17:25 -0400 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2012-07-03 11:29:04 -0400 |
commit | d077af41b3daae5a170d417b3841f94e168a6087 (patch) | |
tree | 5b48d1f295288bbfeb2ffee48fd1b0eeb860c13c | |
parent | 29c11f715b98262eda3cfd73e502c59dbb3c3429 (diff) |
ext4: force ro mount if ext4_setup_super() fails
BugLink: http://bugs.launchpad.net/bugs/1013748
commit 7e84b6216467b84cd332c8e567bf5aa113fd2f38 upstream.
If ext4_setup_super() fails i.e. due to a too-high revision,
the error is logged in dmesg but the fs is not mounted RO as
indicated.
Tested by:
# mkfs.ext4 -r 4 /dev/sdb6
# mount /dev/sdb6 /mnt/test
# dmesg | grep "too high"
[164919.759248] EXT4-fs (sdb6): revision level too high, forcing read-only mode
# grep sdb6 /proc/mounts
/dev/sdb6 /mnt/test2 ext4 rw,seclabel,relatime,data=ordered 0 0
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
-rw-r--r-- | fs/ext4/super.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index df121b20b0d..be6c0ccd822 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3618,7 +3618,8 @@ no_journal: | |||
3618 | goto failed_mount4; | 3618 | goto failed_mount4; |
3619 | } | 3619 | } |
3620 | 3620 | ||
3621 | ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY); | 3621 | if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY)) |
3622 | sb->s_flags |= MS_RDONLY; | ||
3622 | 3623 | ||
3623 | /* determine the minimum size of new large inodes, if present */ | 3624 | /* determine the minimum size of new large inodes, if present */ |
3624 | if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { | 3625 | if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { |