* [PATCH] e2fsprogs: fix "Illegal block number" for scan_block_bitmap()
@ 2011-11-10 12:15 Robin Dong
2011-11-12 2:16 ` Ted Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Robin Dong @ 2011-11-10 12:15 UTC (permalink / raw)
To: linux-ext4; +Cc: Robin Dong
From: Robin Dong <sanbai@taobao.com>
After:
# mke2fs -O ^has_journal,^resize_inode,^uninit_bg,extent,meta_bg,flex_bg,bigalloc /dev/sda
# e2freefrag /dev/sda
It will report error message like:
Illegal block number passed to ext2fs_test_block_bitmap #1732133 for block bitmap for /dev/sda
Illegal block number passed to ext2fs_test_block_bitmap #1732134 for block bitmap for /dev/sda
Illegal block number passed to ext2fs_test_block_bitmap #1732135 for block bitmap for /dev/sda
One bit in bitmap of bigalloc-ext4 means a cluster not a block, therefore ext2fs_fast_test_block_bitmap2
should check cluster.
Signed-off-by: Robin Dong <sanbai@taobao.com>
---
misc/e2freefrag.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/misc/e2freefrag.c b/misc/e2freefrag.c
index b442f32..a09df6b 100644
--- a/misc/e2freefrag.c
+++ b/misc/e2freefrag.c
@@ -121,7 +121,7 @@ void scan_block_bitmap(ext2_filsys fs, struct chunk_info *info)
chunk_start_blk = blk;
}
used = ext2fs_fast_test_block_bitmap2(fs->block_map,
- chunk_start_blk);
+ chunk_start_blk >> fs->cluster_ratio_bits);
if (!used) {
last_chunk_size++;
chunk_free++;
--
1.7.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] e2fsprogs: fix "Illegal block number" for scan_block_bitmap()
2011-11-10 12:15 [PATCH] e2fsprogs: fix "Illegal block number" for scan_block_bitmap() Robin Dong
@ 2011-11-12 2:16 ` Ted Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-11-12 2:16 UTC (permalink / raw)
To: Robin Dong; +Cc: linux-ext4, Robin Dong
On Thu, Nov 10, 2011 at 08:15:24PM +0800, Robin Dong wrote:
> From: Robin Dong <sanbai@taobao.com>
>
> After:
> # mke2fs -O ^has_journal,^resize_inode,^uninit_bg,extent,meta_bg,flex_bg,bigalloc /dev/sda
> # e2freefrag /dev/sda
>
> It will report error message like:
>
> Illegal block number passed to ext2fs_test_block_bitmap #1732133 for block bitmap for /dev/sda
> Illegal block number passed to ext2fs_test_block_bitmap #1732134 for block bitmap for /dev/sda
> Illegal block number passed to ext2fs_test_block_bitmap #1732135 for block bitmap for /dev/sda
>
> One bit in bitmap of bigalloc-ext4 means a cluster not a block, therefore ext2fs_fast_test_block_bitmap2
> should check cluster.
>
> Signed-off-by: Robin Dong <sanbai@taobao.com>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-12 5:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10 12:15 [PATCH] e2fsprogs: fix "Illegal block number" for scan_block_bitmap() Robin Dong
2011-11-12 2:16 ` Ted Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).