diff options
-rw-r--r-- | lib/ext2fs/block.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c index 51fdd9ad..6ac93797 100644 --- a/lib/ext2fs/block.c +++ b/lib/ext2fs/block.c @@ -364,6 +364,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, e2_blkcnt_t blockcnt = 0; blk_t blk, new_blk; int op = EXT2_EXTENT_ROOT; + int uninit; unsigned int j; ctx.errcode = ext2fs_extent_open(fs, ino, &handle); @@ -419,6 +420,9 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, } continue; } + uninit = 0; + if (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT) + uninit = EXT2_EXTENT_SET_BMAP_UNINIT; for (blockcnt = extent.e_lblk, j = 0; j < extent.e_len; blk++, blockcnt++, j++) { @@ -432,7 +436,8 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, ctx.errcode = ext2fs_extent_set_bmap(handle, (blk64_t) blockcnt, - (blk64_t) new_blk, 0); + (blk64_t) new_blk, + uninit); if (ctx.errcode) goto extent_errout; } |