Skip to content

Commit

Permalink
Btrfs: dev-replace: skip prealloc extents when copy nocow pages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liu Bo authored and David Sterba committed Mar 26, 2018
1 parent d612ac5 commit ed5d5f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed5d5f3

Please sign in to comment.