diff options
author | kib <kib@FreeBSD.org> | 2009-01-04 15:56:49 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-01-04 15:56:49 +0000 |
commit | 67a76167a42f3ac5c55619559e2e17cf28549dd7 (patch) | |
tree | 52b78dbce405dd753b4813f01313781a9b2f7649 /sys/gnu | |
parent | 441b9aa0f3035a6b0136f0e5472371d3faadeab7 (diff) | |
download | FreeBSD-src-67a76167a42f3ac5c55619559e2e17cf28549dd7.zip FreeBSD-src-67a76167a42f3ac5c55619559e2e17cf28549dd7.tar.gz |
Do not incorrectly add the low 5 bits of the offset to the resulting
position of the found zero bit.
Submitted by: Jaakko Heinonen <jh saunalahti fi>
MFC after: 2 weeks
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_bitops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_bitops.h b/sys/gnu/fs/ext2fs/ext2_bitops.h index 0ee54a1..c01150f 100644 --- a/sys/gnu/fs/ext2fs/ext2_bitops.h +++ b/sys/gnu/fs/ext2fs/ext2_bitops.h @@ -84,7 +84,7 @@ find_next_zero_bit(void *data, size_t sz, size_t ofs) mask = ~0U << (ofs & 31); bit = *p | ~mask; if (bit != ~0U) - return (ffs(~bit) + ofs - 1); + return (ffs(~bit) + (ofs & ~31U) - 1); p++; ofs = (ofs + 31U) & ~31U; } |