On Wed, Apr 14, 2021 at 1:35 PM Johannes Thumshirn <johannes.thumsh...@wdc.com> wrote: > > On 14/04/2021 14:09, fdman...@kernel.org wrote: > > From: Filipe Manana <fdman...@suse.com> > > > > When doing a device replace on a zoned filesystem, if we find a block > > group with ->to_copy == 0, we jump to the label 'done', which will result > > in later calling btrfs_unfreeze_block_group(), even though at this point > > we never called btrfs_freeze_block_group(). > > > > Since at this point we have neither turned the block group to RO mode nor > > made any progress, we don't need to jump to the label 'done'. So fix this > > by jumping instead to the label 'skip' and dropping our reference on the > > block group before the jump. > > > > Fixes: 78ce9fc269af6e ("btrfs: zoned: mark block groups to copy for > > device-replace") > > Signed-off-by: Filipe Manana <fdman...@suse.com> > > --- > > fs/btrfs/scrub.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c > > index 17e49caad1f9..e0d54ed9acee 100644 > > --- a/fs/btrfs/scrub.c > > +++ b/fs/btrfs/scrub.c > > @@ -3674,8 +3674,8 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx, > > spin_lock(&cache->lock); > > if (!cache->to_copy) { > > spin_unlock(&cache->lock); > > - ro_set = 0; > > - goto done; > > + btrfs_put_block_group(cache); > > + goto skip; > > } > > spin_unlock(&cache->lock); > > } > > > > I think we can remove the 'done' label as well, as after this patch it is > unused (at least on my clone of misc-next).
Indeed, I missed that. Removed in v2, thanks. > > Otherwise, > Reviewed-by: Johannes Thumshirn <johannes.thumsh...@wdc.com>