Skip to content

Commit ed5d5f3

Browse files
Liu Bokdave
authored andcommitted
Btrfs: dev-replace: skip prealloc extents when copy nocow pages
It doens't make sense to process prealloc extents as pages will be filled with zero when reading prealloc extents. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent d612ac5 commit ed5d5f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/btrfs/scrub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4480,7 +4480,8 @@ static int check_extent_to_block(struct btrfs_inode *inode, u64 start, u64 len,
44804480
* move on to the next inode.
44814481
*/
44824482
if (em->block_start > logical ||
4483-
em->block_start + em->block_len < logical + len) {
4483+
em->block_start + em->block_len < logical + len ||
4484+
test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) {
44844485
free_extent_map(em);
44854486
ret = 1;
44864487
goto out_unlock;

0 commit comments

Comments
 (0)