ext4: fix journal_ioprio mount option handling
[linux-2.6-microblaze.git] / fs / ext4 / super.c
index b511203..4b0ea8d 100644 (file)
@@ -4411,7 +4411,8 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
        int silent = fc->sb_flags & SB_SILENT;
 
        /* Set defaults for the variables that will be set during parsing */
-       ctx->journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
+       if (!(ctx->spec & EXT4_SPEC_JOURNAL_IOPRIO))
+               ctx->journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
 
        sbi->s_inode_readahead_blks = EXT4_DEF_INODE_READAHEAD_BLKS;
        sbi->s_sectors_written_start =
@@ -6278,7 +6279,6 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
        char *to_free[EXT4_MAXQUOTAS];
 #endif
 
-       ctx->journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
 
        /* Store the original options */
        old_sb_flags = sb->s_flags;
@@ -6304,9 +6304,14 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
                } else
                        old_opts.s_qf_names[i] = NULL;
 #endif
-       if (sbi->s_journal && sbi->s_journal->j_task->io_context)
-               ctx->journal_ioprio =
-                       sbi->s_journal->j_task->io_context->ioprio;
+       if (!(ctx->spec & EXT4_SPEC_JOURNAL_IOPRIO)) {
+               if (sbi->s_journal && sbi->s_journal->j_task->io_context)
+                       ctx->journal_ioprio =
+                               sbi->s_journal->j_task->io_context->ioprio;
+               else
+                       ctx->journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
+
+       }
 
        ext4_apply_options(fc, sb);