]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ext4: return EROFS if device is r/o and journal replay is needed
authorTheodore Ts'o <tytso@mit.edu>
Sun, 5 Feb 2017 06:26:48 +0000 (01:26 -0500)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 6 Apr 2017 08:21:21 +0000 (09:21 +0100)
BugLink: http://bugs.launchpad.net/bugs/1673538
commit 4753d8a24d4588657bc0a4cd66d4e282dff15c8c upstream.

If the file system requires journal recovery, and the device is
read-ony, return EROFS to the mount system call.  This allows xfstests
generic/050 to pass.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/ext4/super.c

index 1022c191e6f8ba812b50cbdbd393e2f507b07413..7481927a47933792f774ddd58006957238042391 100644 (file)
@@ -3783,7 +3783,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
         * root first: it may be modified in the journal!
         */
        if (!test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb)) {
-               if (ext4_load_journal(sb, es, journal_devnum))
+               err = ext4_load_journal(sb, es, journal_devnum);
+               if (err)
                        goto failed_mount3a;
        } else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
                   ext4_has_feature_journal_needs_recovery(sb)) {