mirror of https://github.com/vitalif/e2fsprogs
e2fsck: Try to update on-disk bitmap in e2fsck_get_alloc_block() callback
The e2fsck_get_alloc_block() callback is used so that if the ext2fs library needs to allocate blocks internally (most notably by the extents functions), e2fsck's internal block usage map is consulted since it is the only thing that can be trusted during a large part of e2fsck's operation. Change it to update the on-disk bitmap if it is loaded. This reduces the number of spurious differences found in pass #5. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>bitmap-optimize
parent
f4e14505ed
commit
8a2cbe2c6d
|
@ -2628,6 +2628,10 @@ static errcode_t e2fsck_get_alloc_block(ext2_filsys fs, blk64_t goal,
|
||||||
ctx->block_found_map, &new_block);
|
ctx->block_found_map, &new_block);
|
||||||
if (retval)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
|
if (fs->block_map) {
|
||||||
|
ext2fs_mark_block_bitmap(fs->block_map, new_block);
|
||||||
|
ext2fs_mark_bb_dirty(fs);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!fs->block_map) {
|
if (!fs->block_map) {
|
||||||
retval = ext2fs_read_block_bitmap(fs);
|
retval = ext2fs_read_block_bitmap(fs);
|
||||||
|
|
Loading…
Reference in New Issue