ext4: return EROFS if device is r/o and journal replay is needed
[firefly-linux-kernel-4.4.55.git] / fs / ext4 / super.c
index 2f7b74e07fb0ea3793746cc13af90b79ccff10ef..6fe8e30eeb99d79d48e8bf0089ed80c336461b11 100644 (file)
@@ -3748,7 +3748,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)) {