btrfs: zoned: relocate block group to repair IO failure in zoned filesystems
[platform/kernel/linux-rpi.git] / fs / btrfs / scrub.c
index e0c3ec0..310fce0 100644 (file)
@@ -857,6 +857,9 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)
        have_csum = sblock_to_check->pagev[0]->have_csum;
        dev = sblock_to_check->pagev[0]->dev;
 
+       if (btrfs_is_zoned(fs_info) && !sctx->is_dev_replace)
+               return btrfs_repair_one_zone(fs_info, logical);
+
        /*
         * We must use GFP_NOFS because the scrub task might be waiting for a
         * worker task executing this function and in turn a transaction commit