]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jul 2014 18:24:45 +0000 (11:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jul 2014 18:24:45 +0000 (11:24 -0700)
added patches:
ext4-clarify-error-count-warning-messages.patch
ext4-clarify-ext4_error-message-in-ext4_mb_generate_buddy_error.patch
ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch
ext4-fix-a-potential-deadlock-in-__ext4_es_shrink.patch
ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch

queue-3.14/ext4-clarify-error-count-warning-messages.patch [new file with mode: 0644]
queue-3.14/ext4-clarify-ext4_error-message-in-ext4_mb_generate_buddy_error.patch [new file with mode: 0644]
queue-3.14/ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch [new file with mode: 0644]
queue-3.14/ext4-fix-a-potential-deadlock-in-__ext4_es_shrink.patch [new file with mode: 0644]
queue-3.14/ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch [new file with mode: 0644]
queue-3.14/series

diff --git a/queue-3.14/ext4-clarify-error-count-warning-messages.patch b/queue-3.14/ext4-clarify-error-count-warning-messages.patch
new file mode 100644 (file)
index 0000000..98a931e
--- /dev/null
@@ -0,0 +1,46 @@
+From ae0f78de2c43b6fadd007c231a352b13b5be8ed2 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sat, 5 Jul 2014 18:40:52 -0400
+Subject: ext4: clarify error count warning messages
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+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 <pavel@ucw.cz>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reviewed-by: Andreas Dilger <adilger@dilger.ca>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/super.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -2793,10 +2793,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,
+@@ -2810,7 +2811,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.14/ext4-clarify-ext4_error-message-in-ext4_mb_generate_buddy_error.patch b/queue-3.14/ext4-clarify-ext4_error-message-in-ext4_mb_generate_buddy_error.patch
new file mode 100644 (file)
index 0000000..1fa3d1f
--- /dev/null
@@ -0,0 +1,32 @@
+From 94d4c066a4ff170a2671b1a9b153febbf36796f6 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sat, 5 Jul 2014 19:15:50 -0400
+Subject: ext4: clarify ext4_error message in ext4_mb_generate_buddy_error()
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+commit 94d4c066a4ff170a2671b1a9b153febbf36796f6 upstream.
+
+We are spending a lot of time explaining to users what this error
+means.  Let's try to improve the message to avoid this problem.
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/mballoc.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/ext4/mballoc.c
++++ b/fs/ext4/mballoc.c
+@@ -751,8 +751,8 @@ void ext4_mb_generate_buddy(struct super
+       if (free != grp->bb_free) {
+               ext4_grp_locked_error(sb, group, 0, 0,
+-                                    "%u clusters in bitmap, %u in gd; "
+-                                    "block bitmap corrupt.",
++                                    "block bitmap and bg descriptor "
++                                    "inconsistent: %u vs %u free clusters",
+                                     free, grp->bb_free);
+               /*
+                * If we intend to continue, we consider group descriptor
diff --git a/queue-3.14/ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch b/queue-3.14/ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch
new file mode 100644 (file)
index 0000000..f51339b
--- /dev/null
@@ -0,0 +1,53 @@
+From 5dd214248f94d430d70e9230bda72f2654ac88a8 Mon Sep 17 00:00:00 2001
+From: Eric Sandeen <sandeen@redhat.com>
+Date: Sat, 5 Jul 2014 19:18:22 -0400
+Subject: ext4: disable synchronous transaction batching if max_batch_time==0
+
+From: Eric Sandeen <sandeen@redhat.com>
+
+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 <sandeen@redhat.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -1519,8 +1519,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
+@@ -1590,9 +1590,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.14/ext4-fix-a-potential-deadlock-in-__ext4_es_shrink.patch b/queue-3.14/ext4-fix-a-potential-deadlock-in-__ext4_es_shrink.patch
new file mode 100644 (file)
index 0000000..422e4ee
--- /dev/null
@@ -0,0 +1,92 @@
+From 3f1f9b851311a76226140b55b1ea22111234a7c2 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sat, 12 Jul 2014 15:32:24 -0400
+Subject: ext4: fix a potential deadlock in __ext4_es_shrink()
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+commit 3f1f9b851311a76226140b55b1ea22111234a7c2 upstream.
+
+This fixes the following lockdep complaint:
+
+[ INFO: possible circular locking dependency detected ]
+3.16.0-rc2-mm1+ #7 Tainted: G           O
+-------------------------------------------------------
+kworker/u24:0/4356 is trying to acquire lock:
+ (&(&sbi->s_es_lru_lock)->rlock){+.+.-.}, at: [<ffffffff81285fff>] __ext4_es_shrink+0x4f/0x2e0
+
+but task is already holding lock:
+ (&ei->i_es_lock){++++-.}, at: [<ffffffff81286961>] ext4_es_insert_extent+0x71/0x180
+
+which lock already depends on the new lock.
+
+ Possible unsafe locking scenario:
+
+       CPU0                    CPU1
+       ----                    ----
+  lock(&ei->i_es_lock);
+                               lock(&(&sbi->s_es_lru_lock)->rlock);
+                               lock(&ei->i_es_lock);
+  lock(&(&sbi->s_es_lru_lock)->rlock);
+
+ *** DEADLOCK ***
+
+6 locks held by kworker/u24:0/4356:
+ #0:  ("writeback"){.+.+.+}, at: [<ffffffff81071d00>] process_one_work+0x180/0x560
+ #1:  ((&(&wb->dwork)->work)){+.+.+.}, at: [<ffffffff81071d00>] process_one_work+0x180/0x560
+ #2:  (&type->s_umount_key#22){++++++}, at: [<ffffffff811a9c74>] grab_super_passive+0x44/0x90
+ #3:  (jbd2_handle){+.+...}, at: [<ffffffff812979f9>] start_this_handle+0x189/0x5f0
+ #4:  (&ei->i_data_sem){++++..}, at: [<ffffffff81247062>] ext4_map_blocks+0x132/0x550
+ #5:  (&ei->i_es_lock){++++-.}, at: [<ffffffff81286961>] ext4_es_insert_extent+0x71/0x180
+
+stack backtrace:
+CPU: 0 PID: 4356 Comm: kworker/u24:0 Tainted: G           O   3.16.0-rc2-mm1+ #7
+Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
+Workqueue: writeback bdi_writeback_workfn (flush-253:0)
+ ffffffff8213dce0 ffff880014b07538 ffffffff815df0bb 0000000000000007
+ ffffffff8213e040 ffff880014b07588 ffffffff815db3dd ffff880014b07568
+ ffff880014b07610 ffff88003b868930 ffff88003b868908 ffff88003b868930
+Call Trace:
+ [<ffffffff815df0bb>] dump_stack+0x4e/0x68
+ [<ffffffff815db3dd>] print_circular_bug+0x1fb/0x20c
+ [<ffffffff810a7a3e>] __lock_acquire+0x163e/0x1d00
+ [<ffffffff815e89dc>] ? retint_restore_args+0xe/0xe
+ [<ffffffff815ddc7b>] ? __slab_alloc+0x4a8/0x4ce
+ [<ffffffff81285fff>] ? __ext4_es_shrink+0x4f/0x2e0
+ [<ffffffff810a8707>] lock_acquire+0x87/0x120
+ [<ffffffff81285fff>] ? __ext4_es_shrink+0x4f/0x2e0
+ [<ffffffff8128592d>] ? ext4_es_free_extent+0x5d/0x70
+ [<ffffffff815e6f09>] _raw_spin_lock+0x39/0x50
+ [<ffffffff81285fff>] ? __ext4_es_shrink+0x4f/0x2e0
+ [<ffffffff8119760b>] ? kmem_cache_alloc+0x18b/0x1a0
+ [<ffffffff81285fff>] __ext4_es_shrink+0x4f/0x2e0
+ [<ffffffff812869b8>] ext4_es_insert_extent+0xc8/0x180
+ [<ffffffff812470f4>] ext4_map_blocks+0x1c4/0x550
+ [<ffffffff8124c4c4>] ext4_writepages+0x6d4/0xd00
+       ...
+
+Reported-by: Minchan Kim <minchan@kernel.org>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reported-by: Minchan Kim <minchan@kernel.org>
+Cc: Zheng Liu <gnehzuil.liu@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/extents_status.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/ext4/extents_status.c
++++ b/fs/ext4/extents_status.c
+@@ -962,10 +962,10 @@ retry:
+                       continue;
+               }
+-              if (ei->i_es_lru_nr == 0 || ei == locked_ei)
++              if (ei->i_es_lru_nr == 0 || ei == locked_ei ||
++                  !write_trylock(&ei->i_es_lock))
+                       continue;
+-              write_lock(&ei->i_es_lock);
+               shrunk = __es_try_to_reclaim_extents(ei, nr_to_scan);
+               if (ei->i_es_lru_nr == 0)
+                       list_del_init(&ei->i_es_lru);
diff --git a/queue-3.14/ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch b/queue-3.14/ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch
new file mode 100644 (file)
index 0000000..486c0ff
--- /dev/null
@@ -0,0 +1,54 @@
+From 61c219f5814277ecb71d64cb30297028d6665979 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sat, 5 Jul 2014 16:28:35 -0400
+Subject: ext4: fix unjournalled bg descriptor while initializing inode bitmap
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+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 <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/ialloc.c |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+--- a/fs/ext4/ialloc.c
++++ b/fs/ext4/ialloc.c
+@@ -851,6 +851,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)) {
+@@ -887,13 +894,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;
index 031408aae16cd02c27c6f6396b4164536e61d88f..276a97a8b28b120ac0b8d5be448b230150a0ed77 100644 (file)
@@ -40,3 +40,8 @@ intel_pstate-don-t-touch-turbo-bit-if-turbo-disabled-or-unavailable.patch
 intel_pstate-update-documentation-of-max-min-_perf_pct-sysfs-files.patch
 intel_pstate-set-cpu-number-before-accessing-msrs.patch
 pci-fix-unaligned-access-in-af-transaction-pending-test.patch
+ext4-fix-unjournalled-bg-descriptor-while-initializing-inode-bitmap.patch
+ext4-clarify-error-count-warning-messages.patch
+ext4-clarify-ext4_error-message-in-ext4_mb_generate_buddy_error.patch
+ext4-disable-synchronous-transaction-batching-if-max_batch_time-0.patch
+ext4-fix-a-potential-deadlock-in-__ext4_es_shrink.patch