diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2018-02-27 18:10:58 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-26 15:09:40 +0200 |
commit | ed5d5f37e653b606c93b2d5f1cdd155be6fefce0 (patch) | |
tree | 0e20a6ff64e1121fdda10cd08a5a6815da30ef36 /fs/btrfs/scrub.c | |
parent | d612ac59efc3b57858f310c8471d7ee2779658c9 (diff) | |
download | linux-stable-ed5d5f37e653b606c93b2d5f1cdd155be6fefce0.tar.gz linux-stable-ed5d5f37e653b606c93b2d5f1cdd155be6fefce0.tar.bz2 linux-stable-ed5d5f37e653b606c93b2d5f1cdd155be6fefce0.zip |
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>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index beb441d0c5c6..9fb7d09842e6 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; |