]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
btrfs: set search_commit_root on stripe io in case of relocation
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Wed, 31 Jul 2024 20:43:05 +0000 (22:43 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 10 Sep 2024 14:51:17 +0000 (16:51 +0200)
Set rst_search_commit_root in the btrfs_io_stripe we're passing to
btrfs_map_block() in case we're doing data relocation.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/bio.c

index 36d0e52faeecda7757d14f29380e014f5eb3ee10..f6cb58d7f16a46e5280bdc980691e5e0ea8829d8 100644 (file)
@@ -678,7 +678,10 @@ static bool btrfs_submit_chunk(struct btrfs_bio *bbio, int mirror_num)
        blk_status_t ret;
        int error;
 
-       smap.rst_search_commit_root = !bbio->inode;
+       if (!bbio->inode || btrfs_is_data_reloc_root(inode->root))
+               smap.rst_search_commit_root = true;
+       else
+               smap.rst_search_commit_root = false;
 
        btrfs_bio_counter_inc_blocked(fs_info);
        error = btrfs_map_block(fs_info, btrfs_op(bio), logical, &map_length,