]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Btrfs: dev-replace: skip prealloc extents when copy nocow pages
authorLiu Bo <bo.li.liu@oracle.com>
Wed, 28 Feb 2018 01:10:58 +0000 (18:10 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Mar 2018 13:09:40 +0000 (15:09 +0200)
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>
fs/btrfs/scrub.c

index beb441d0c5c6c02e816d8d5c74bebf8fb5c92c0a..9fb7d09842e641fe4bd5b731e7da0d769a3c9e24 100644 (file)
@@ -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;