From 447be3f1e442be3606c449e856edc934d8d301d7 Mon Sep 17 00:00:00 2001 From: Martin Cracauer Date: Thu, 13 Apr 2006 19:37:32 +0000 Subject: [PATCH] Repair ext2fs writes. Strong candidate for backport to 6.x. When allocating new blocks, the search for block group beginnings would fail with a segfault. There was a side-effect read access with an off-by-one errors. The results were not used in the error case so the code worked in the past. But now the FreeBSD kernel has tighter mappings and the word accessed is not mapped (for me). The Linux kernel has rewritten most of the allocation strategy by now. Also, the Linux kernel cleaned up the integration of these files and it look feasable to wrap the original Linux files in wrapper that provides their favorite arguments instead of dragging around our own code. --- sys/gnu/fs/ext2fs/ext2_bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/gnu/fs/ext2fs/ext2_bitops.h b/sys/gnu/fs/ext2fs/ext2_bitops.h index 47d76cf5d7e9..0ee54a1a76ed 100644 --- a/sys/gnu/fs/ext2fs/ext2_bitops.h +++ b/sys/gnu/fs/ext2fs/ext2_bitops.h @@ -88,7 +88,7 @@ find_next_zero_bit(void *data, size_t sz, size_t ofs) p++; ofs = (ofs + 31U) & ~31U; } - while(*p == ~0U && ofs < sz) { + while(ofs < sz && *p == ~0U) { p++; ofs += 32; }