diff options
author | Johannes Thumshirn <johannes.thumshirn@wdc.com> | 2021-12-07 06:28:36 -0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-01-07 14:18:26 +0100 |
commit | 554aed7da29bcadb3ee3cfdc1376da660d3fc849 (patch) | |
tree | 2928f0e946007f16721f5d783d4aa1ee706fd261 /fs/btrfs/scrub.c | |
parent | 8fdf54fe69a7a0f11542c2dd322b590a5b935918 (diff) |
btrfs: zoned: sink zone check into btrfs_repair_one_zone
Sink zone check into btrfs_repair_one_zone() so we don't need to do it
in all callers.
Also as btrfs_repair_one_zone() doesn't return a sensible error, make it
a boolean function and return false in case it got called on a non-zoned
filesystem and true on a zoned filesystem.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 4afa5ae17989..f28ae41b1df3 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -845,8 +845,8 @@ 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); + if (!sctx->is_dev_replace && btrfs_repair_one_zone(fs_info, logical)) + return 0; /* * We must use GFP_NOFS because the scrub task might be waiting for a |