The patch titled
     From: Konstantin Khlebnikov <[email protected]>
has been removed from the -mm tree.  Its filename was
     radix-tree-fix-contiguous-iterator.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: radix-tree: fix contiguous iterator
From: Konstantin Khlebnikov <[email protected]>

Fix a bug in the 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.

More details at https://lkml.org/lkml/2012/6/5/64

Signed-off-by: Konstantin Khlebnikov <[email protected]>
Reported-by: Hans de Bruin <[email protected]>
Reported-by: Ondrej Zary <[email protected]>
Reported-by: Toralf Foerster <[email protected]>
Cc: <[email protected]>    [3.4.x]
Signed-off-by: Andrew Morton <[email protected]>
---

 include/linux/radix-tree.h |    5 ++++-
 lib/radix-tree.c           |    3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff -puN include/linux/radix-tree.h~radix-tree-fix-contiguous-iterator 
include/linux/radix-tree.h
--- a/include/linux/radix-tree.h~radix-tree-fix-contiguous-iterator
+++ a/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;
diff -puN lib/radix-tree.c~radix-tree-fix-contiguous-iterator lib/radix-tree.c
--- a/lib/radix-tree.c~radix-tree-fix-contiguous-iterator
+++ a/lib/radix-tree.c
@@ -686,6 +686,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)
_

Patches currently in -mm which might be from [email protected] are

origin.patch
linux-next.patch
mm-correctly-synchronize-rss-counters-at-exit-exec.patch
c-r-prctl-add-ability-to-set-new-mm_struct-exe_file-update-after-mm-num_exe_file_vmas-removal.patch

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to