Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext3: force ro mount if ext3_setup_super() fails

If ext3_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:

[164152.114551] EXT3-fs (sdb6): error: revision level too high, forcing read-only mode
/dev/sdb6 /mnt/test2 ext3 rw,seclabel,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
^^

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Eric Sandeen and committed by
Jan Kara
f007dbf8 f3da9310

+2 -1
+2 -1
fs/ext3/super.c
··· 2058 2058 goto failed_mount3; 2059 2059 } 2060 2060 2061 - ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY); 2061 + if (ext3_setup_super(sb, es, sb->s_flags & MS_RDONLY)) 2062 + sb->s_flags |= MS_RDONLY; 2062 2063 2063 2064 EXT3_SB(sb)->s_mount_state |= EXT3_ORPHAN_FS; 2064 2065 ext3_orphan_cleanup(sb, es);