From: Greg Kroah-Hartman Date: Mon, 14 Jul 2014 18:24:42 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.4.99~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15a6bbac11cd04172f42a220fae0655acb9524f1;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: ext4-clarify-error-count-warning-messages.patch ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch --- diff --git a/queue-3.10/ext4-clarify-error-count-warning-messages.patch b/queue-3.10/ext4-clarify-error-count-warning-messages.patch new file mode 100644 index 00000000000..e5d0fb81823 --- /dev/null +++ b/queue-3.10/ext4-clarify-error-count-warning-messages.patch @@ -0,0 +1,46 @@ +From ae0f78de2c43b6fadd007c231a352b13b5be8ed2 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 5 Jul 2014 18:40:52 -0400 +Subject: ext4: clarify error count warning messages + +From: Theodore Ts'o + +commit ae0f78de2c43b6fadd007c231a352b13b5be8ed2 upstream. + +Make it clear that values printed are times, and that it is error +since last fsck. Also add note about fsck version required. + +Signed-off-by: Pavel Machek +Signed-off-by: Theodore Ts'o +Reviewed-by: Andreas Dilger +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -2687,10 +2687,11 @@ static void print_daily_error_info(unsig + es = sbi->s_es; + + if (es->s_error_count) +- ext4_msg(sb, KERN_NOTICE, "error count: %u", ++ /* fsck newer than v1.41.13 is needed to clean this condition. */ ++ ext4_msg(sb, KERN_NOTICE, "error count since last fsck: %u", + le32_to_cpu(es->s_error_count)); + if (es->s_first_error_time) { +- printk(KERN_NOTICE "EXT4-fs (%s): initial error at %u: %.*s:%d", ++ printk(KERN_NOTICE "EXT4-fs (%s): initial error at time %u: %.*s:%d", + sb->s_id, le32_to_cpu(es->s_first_error_time), + (int) sizeof(es->s_first_error_func), + es->s_first_error_func, +@@ -2704,7 +2705,7 @@ static void print_daily_error_info(unsig + printk("\n"); + } + if (es->s_last_error_time) { +- printk(KERN_NOTICE "EXT4-fs (%s): last error at %u: %.*s:%d", ++ printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d", + sb->s_id, le32_to_cpu(es->s_last_error_time), + (int) sizeof(es->s_last_error_func), + es->s_last_error_func, diff --git a/queue-3.10/ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch b/queue-3.10/ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch new file mode 100644 index 00000000000..8ce6ece113f --- /dev/null +++ b/queue-3.10/ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch @@ -0,0 +1,53 @@ +From 5dd214248f94d430d70e9230bda72f2654ac88a8 Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Sat, 5 Jul 2014 19:18:22 -0400 +Subject: ext4: disable synchronous transaction batching if max_batch_time==0 + +From: Eric Sandeen + +commit 5dd214248f94d430d70e9230bda72f2654ac88a8 upstream. + +The mount manpage says of the max_batch_time option, + + This optimization can be turned off entirely + by setting max_batch_time to 0. + +But the code doesn't do that. So fix the code to do +that. + +Signed-off-by: Eric Sandeen +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 2 -- + fs/jbd2/transaction.c | 5 ++++- + 2 files changed, 4 insertions(+), 3 deletions(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -1483,8 +1483,6 @@ static int handle_mount_opt(struct super + arg = JBD2_DEFAULT_MAX_COMMIT_AGE; + sbi->s_commit_interval = HZ * arg; + } else if (token == Opt_max_batch_time) { +- if (arg == 0) +- arg = EXT4_DEF_MAX_BATCH_TIME; + sbi->s_max_batch_time = arg; + } else if (token == Opt_min_batch_time) { + sbi->s_min_batch_time = arg; +--- a/fs/jbd2/transaction.c ++++ b/fs/jbd2/transaction.c +@@ -1442,9 +1442,12 @@ int jbd2_journal_stop(handle_t *handle) + * to perform a synchronous write. We do this to detect the + * case where a single process is doing a stream of sync + * writes. No point in waiting for joiners in that case. ++ * ++ * Setting max_batch_time to 0 disables this completely. + */ + pid = current->pid; +- if (handle->h_sync && journal->j_last_sync_writer != pid) { ++ if (handle->h_sync && journal->j_last_sync_writer != pid && ++ journal->j_max_batch_time) { + u64 commit_time, trans_time; + + journal->j_last_sync_writer = pid; diff --git a/queue-3.10/ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch b/queue-3.10/ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch new file mode 100644 index 00000000000..08d67d7e02d --- /dev/null +++ b/queue-3.10/ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch @@ -0,0 +1,54 @@ +From 61c219f5814277ecb71d64cb30297028d6665979 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 5 Jul 2014 16:28:35 -0400 +Subject: ext4: fix unjournalled bg descriptor while initializing inode bitmap + +From: Theodore Ts'o + +commit 61c219f5814277ecb71d64cb30297028d6665979 upstream. + +The first time that we allocate from an uninitialized inode allocation +bitmap, if the block allocation bitmap is also uninitalized, we need +to get write access to the block group descriptor before we start +modifying the block group descriptor flags and updating the free block +count, etc. Otherwise, there is the potential of a bad journal +checksum (if journal checksums are enabled), and of the file system +becoming inconsistent if we crash at exactly the wrong time. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/ialloc.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +--- a/fs/ext4/ialloc.c ++++ b/fs/ext4/ialloc.c +@@ -780,6 +780,13 @@ got: + goto out; + } + ++ BUFFER_TRACE(group_desc_bh, "get_write_access"); ++ err = ext4_journal_get_write_access(handle, group_desc_bh); ++ if (err) { ++ ext4_std_error(sb, err); ++ goto out; ++ } ++ + /* We may have to initialize the block bitmap if it isn't already */ + if (ext4_has_group_desc_csum(sb) && + gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { +@@ -816,13 +823,6 @@ got: + } + } + +- BUFFER_TRACE(group_desc_bh, "get_write_access"); +- err = ext4_journal_get_write_access(handle, group_desc_bh); +- if (err) { +- ext4_std_error(sb, err); +- goto out; +- } +- + /* Update the relevant bg descriptor fields */ + if (ext4_has_group_desc_csum(sb)) { + int free; diff --git a/queue-3.10/series b/queue-3.10/series index d49bd767268..28f387a9c50 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -19,3 +19,6 @@ arm64-implement-task_size_of.patch clk-spear3xx-use-proper-control-register-offset.patch drivers-hv-vmbus-fix-a-bug-in-the-channel-callback-dispatch-code.patch dm-io-fix-a-race-condition-in-the-wake-up-code-for-sync_io.patch +ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch +ext4-clarify-error-count-warning-messages.patch +ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch