]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
mke2fs: fix setting bad blocks in the block bitmap
authorLi Dongyang <dongyangli@ddn.com>
Wed, 20 Nov 2019 04:35:24 +0000 (04:35 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Jan 2020 18:41:35 +0000 (13:41 -0500)
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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/mke2fs.c

index d7cf257e9f350e75292900ea62ed4f54c4904173..30e353d335c3e018c8dec94c0f36ca14f7fbc7f9 100644 (file)
@@ -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);
 }