]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jun 2012 05:37:31 +0000 (14:37 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jun 2012 05:37:31 +0000 (14:37 +0900)
added patches:
radix-tree-fix-contiguous-iterator.patch

queue-3.4/radix-tree-fix-contiguous-iterator.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/radix-tree-fix-contiguous-iterator.patch b/queue-3.4/radix-tree-fix-contiguous-iterator.patch
new file mode 100644 (file)
index 0000000..7421be6
--- /dev/null
@@ -0,0 +1,58 @@
+From fffaee365fded09f9ebf2db19066065fa54323c3 Mon Sep 17 00:00:00 2001
+From: Konstantin Khlebnikov <khlebnikov@openvz.org>
+Date: Tue, 5 Jun 2012 21:36:33 +0400
+Subject: radix-tree: fix contiguous iterator
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Konstantin Khlebnikov <khlebnikov@openvz.org>
+
+commit fffaee365fded09f9ebf2db19066065fa54323c3 upstream.
+
+This patch fixes bug in macro radix_tree_for_each_contig().
+
+If radix_tree_next_slot() sees NULL in next slot it returns NULL, but following
+radix_tree_next_chunk() switches iterating into next chunk. As result iterating
+becomes non-contiguous and breaks vfs "splice" and all its users.
+
+Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
+Reported-and-bisected-by: Hans de Bruin <jmdebruin@xmsnet.nl>
+Reported-and-bisected-by: Ondrej Zary <linux@rainbow-software.org>
+Reported-bisected-and-tested-by: Toralf Förster <toralf.foerster@gmx.de>
+Link: https://lkml.org/lkml/2012/6/5/64
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/radix-tree.h |    5 ++++-
+ lib/radix-tree.c           |    3 +++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/include/linux/radix-tree.h
++++ b/include/linux/radix-tree.h
+@@ -368,8 +368,11 @@ radix_tree_next_slot(void **slot, struct
+                       iter->index++;
+                       if (likely(*slot))
+                               return slot;
+-                      if (flags & RADIX_TREE_ITER_CONTIG)
++                      if (flags & RADIX_TREE_ITER_CONTIG) {
++                              /* forbid switching to the next chunk */
++                              iter->next_index = 0;
+                               break;
++                      }
+               }
+       }
+       return NULL;
+--- a/lib/radix-tree.c
++++ b/lib/radix-tree.c
+@@ -673,6 +673,9 @@ void **radix_tree_next_chunk(struct radi
+        * during iterating; it can be zero only at the beginning.
+        * And we cannot overflow iter->next_index in a single step,
+        * because RADIX_TREE_MAP_SHIFT < BITS_PER_LONG.
++       *
++       * This condition also used by radix_tree_next_slot() to stop
++       * contiguous iterating, and forbid swithing to the next chunk.
+        */
+       index = iter->next_index;
+       if (!index && iter->index)
index 83cf8f1081d1dca9e829c86aa36145dee313fd77..58371c000206ddfc3a276cbace471d3ae18e318a 100644 (file)
@@ -64,3 +64,4 @@ ext4-add-missing-save_error_info-to-ext4_error.patch
 ext4-don-t-trash-state-flags-in-ext4_ioc_setflags.patch
 ext4-add-ext4_mb_unload_buddy-in-the-error-path.patch
 ext4-remove-mb_groups-before-tearing-down-the-buddy_cache.patch
+radix-tree-fix-contiguous-iterator.patch