From: Peter Williams The implementation of int_sqrt() assumes that longs have 32 bits. On systems that have 64 bit longs this will result in gross errors when the argument to the function is greater than 2^32 - 1 on such systems. I doubt whether any such use is currently made of int_sqrt() but the attached patch fixes the problem anyway. Signed-off-by: Peter Williams Cc: Dave Jones Signed-off-by: Andrew Morton --- lib/int_sqrt.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN lib/int_sqrt.c~lib-fix-bug-in-int_sqrt-for-64-bit-longs lib/int_sqrt.c --- 25/lib/int_sqrt.c~lib-fix-bug-in-int_sqrt-for-64-bit-longs Tue Jan 24 13:50:33 2006 +++ 25-akpm/lib/int_sqrt.c Tue Jan 24 13:50:33 2006 @@ -15,7 +15,7 @@ unsigned long int_sqrt(unsigned long x) op = x; res = 0; - one = 1 << 30; + one = 1UL << (BITS_PER_LONG - 2); while (one > op) one >>= 2; _