diff mbox series

[v3,2/5] mke2fs: fix setting bad blocks in the block bitmap

Message ID 20191120043448.249988-2-dongyangli@ddn.com
State New
Headers show
Series [v3,1/5] libext2fs: optimize ext2fs_convert_subcluster_bitmap() | expand

Commit Message

Li Dongyang Nov. 20, 2019, 4:35 a.m. UTC
We mark the bad blocks as used on fs->block_map
before allocating group tables.
Don't translate the block number to cluster number
when doing this, the fs->block_map is still a
block-granularity allocation map, it will be coverted
later by ext2fs_convert_subcluster_bitmap().

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
---
 misc/mke2fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Theodore Ts'o Dec. 31, 2019, 3:47 a.m. UTC | #1
On Wed, Nov 20, 2019 at 04:35:24AM +0000, Li Dongyang wrote:
> We mark the bad blocks as used on fs->block_map
> before allocating group tables.
> Don't translate the block number to cluster number
> when doing this, the fs->block_map is still a
> block-granularity allocation map, it will be coverted
> later by ext2fs_convert_subcluster_bitmap().
> 
> Signed-off-by: Li Dongyang <dongyangli@ddn.com>

Applied on the maint branch, thanks.  (The other patches need to go on
the e2fsprogs master/next branch, and the last is a kernel patch.)

    	      		  	      	  - Ted
diff mbox series

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index ffea8233..be38d2c4 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -344,7 +344,7 @@  _("Warning: the backup superblock/group descriptors at block %u contain\n"
 		exit(1);
 	}
 	while (ext2fs_badblocks_list_iterate(bb_iter, &blk))
-		ext2fs_mark_block_bitmap2(fs->block_map, EXT2FS_B2C(fs, blk));
+		ext2fs_mark_block_bitmap2(fs->block_map, blk);
 	ext2fs_badblocks_list_iterate_end(bb_iter);
 }