summaryrefslogtreecommitdiff
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-04-23 11:54:02 +0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-04-23 13:07:16 +0400
commitd8bd504ab800c8e9aadb983914a33e7166320bec (patch)
tree72b45fe08363441d53c5e464daa6886a6e11a8b8 /fs/gfs2
parent952043ac12a117d8e94bddd9088338d7ad20ca7d (diff)
downloadlinux-d8bd504ab800c8e9aadb983914a33e7166320bec.tar.xz
GFS2: Fix bug in block allocation
The new bitfit algorithm was counting from the wrong end of 64 bit words in the bitfield. This fixes it by using __ffs64 instead of fls64 Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/rgrp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index f03d024038ea..c9786a46cdfc 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -212,8 +212,7 @@ static u32 gfs2_bitfit(const u8 *buf, const unsigned int len,
if (tmp == 0)
return BFITNOENT;
ptr--;
- bit = fls64(tmp);
- bit--; /* fls64 always adds one to the bit count */
+ bit = __ffs64(tmp);
bit /= 2; /* two bits per entry in the bitmap */
return (((const unsigned char *)ptr - buf) * GFS2_NBBY) + bit;
}