From: Martin Schwidefsky <schwidefsky@de.ibm.com>

The radix tree functions __lookup and __lookup_tag uses (1 << shift) in
their index calculations.  On 64 bit systems the shift can be bigger than
32.  The shift of an integer by more than 32 bits evaluates to zero which
causes the lookup to fail.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/lib/radix-tree.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN lib/radix-tree.c~64-bit-bug-in-radix-tree-lookup lib/radix-tree.c
--- 25/lib/radix-tree.c~64-bit-bug-in-radix-tree-lookup	2004-06-30 10:16:22.788295488 -0700
+++ 25-akpm/lib/radix-tree.c	2004-06-30 10:16:22.792294880 -0700
@@ -494,8 +494,8 @@ __lookup(struct radix_tree_root *root, v
 		for ( ; i < RADIX_TREE_MAP_SIZE; i++) {
 			if (slot->slots[i] != NULL)
 				break;
-			index &= ~((1 << shift) - 1);
-			index += 1 << shift;
+			index &= ~((1UL << shift) - 1);
+			index += 1UL << shift;
 			if (index == 0)
 				goto out;	/* 32-bit wraparound */
 		}
@@ -584,8 +584,8 @@ __lookup_tag(struct radix_tree_root *roo
 				BUG_ON(slot->slots[i] == NULL);
 				break;
 			}
-			index &= ~((1 << shift) - 1);
-			index += 1 << shift;
+			index &= ~((1UL << shift) - 1);
+			index += 1UL << shift;
 			if (index == 0)
 				goto out;	/* 32-bit wraparound */
 		}
_