From: Liu Bo Date: Wed, 28 Feb 2018 01:10:58 +0000 (-0700) Subject: Btrfs: dev-replace: skip prealloc extents when copy nocow pages X-Git-Tag: v5.15~8810^2~126 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed5d5f37e653b606c93b2d5f1cdd155be6fefce0;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Filipe Manana Signed-off-by: David Sterba --- diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index beb441d..9fb7d09 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -4480,7 +4480,8 @@ static int check_extent_to_block(struct btrfs_inode *inode, u64 start, u64 len, * move on to the next inode. */ if (em->block_start > logical || - em->block_start + em->block_len < logical + len) { + em->block_start + em->block_len < logical + len || + test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) { free_extent_map(em); ret = 1; goto out_unlock;