diff options
author | Eric Sandeen <sandeen@redhat.com> | 2012-05-28 22:17:25 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-09 19:36:15 +0400 |
commit | 3c7f096206323ae4c9ad3db62fece0b19df21532 (patch) | |
tree | 04c1ab9e49145719e32813f954cd8a7c159b29af | |
parent | 2c693b1d2fd1789a8b52f3644d41547b1ba9a26e (diff) | |
download | linux-3c7f096206323ae4c9ad3db62fece0b19df21532.tar.xz |
ext4: force ro mount if ext4_setup_super() fails
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>
-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 e1fb1d5de58e..be67c0b91a3d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3592,7 +3592,8 @@ no_journal: goto failed_mount4; } - ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY); + if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY)) + sb->s_flags |= MS_RDONLY; /* determine the minimum size of new large inodes, if present */ if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { |