public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] xfs_lowbit64 broken on ia32
@ 2007-12-03 21:16 David Chinner
  2007-12-05  2:11 ` Lachlan McIlroy
  0 siblings, 1 reply; 12+ messages in thread
From: David Chinner @ 2007-12-03 21:16 UTC (permalink / raw)
  To: xfs-oss; +Cc: xfs-dev


The recent change to the internals of xfs_lowbit64 broke it on
ia32 - the code treats the 64bit value as an unsigned long
which is only 32 bits on ia32 and hence throws away the high 32
bits. 64 bit platforms are not affected.

Tested with a userspace implementation comparing the original
code with the new code.

Signed-off-by: Dave Chinner <dgc@sgi.com>
---
 fs/xfs/xfs_bit.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: 2.6.x-xfs-new/fs/xfs/xfs_bit.h
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_bit.h	2007-11-02 13:44:45.000000000 +1100
+++ 2.6.x-xfs-new/fs/xfs/xfs_bit.h	2007-12-03 14:43:33.169851481 +1100
@@ -68,8 +68,8 @@ static inline int xfs_lowbit32(__uint32_
 /* Get low bit set out of 64-bit argument, -1 if none set */
 static inline int xfs_lowbit64(__uint64_t v)
 {
-	unsigned long	t = v;
-	return (v) ? find_first_bit(&t, 64) : -1;
+	unsigned long long	t = v;
+	return (v) ? find_first_bit((unsigned long *)&t, 64) : -1;
 }
 
 /* Return whether bitmap is empty (1 == empty) */

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-12-06  3:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-03 21:16 [Patch] xfs_lowbit64 broken on ia32 David Chinner
2007-12-05  2:11 ` Lachlan McIlroy
2007-12-05  3:21   ` David Chinner
2007-12-05  5:37     ` Lachlan McIlroy
2007-12-05  5:44       ` David Chinner
2007-12-05  6:35         ` Lachlan McIlroy
2007-12-05 12:14     ` Alex Elder
2007-12-05 13:44       ` Which (lib)acl for 2.4.35? Jameel Akari
2007-12-06  0:04       ` [Patch] xfs_lowbit64 broken on ia32 Timothy Shimmin
2007-12-06  2:15         ` Alex Elder
2007-12-06  1:55       ` David Chinner
2007-12-06  2:22         ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox