* FAILED: patch "[PATCH] btrfs: zoned: clear data relocation bg on zone finish" failed to apply to 5.15-stable tree
@ 2021-12-12 14:21 gregkh
2021-12-13 7:34 ` Johannes Thumshirn
0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2021-12-12 14:21 UTC (permalink / raw)
To: johannes.thumshirn, dsterba, naohiro.aota; +Cc: stable
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5911f5382022aff2b817cb88f276756af229664d Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Date: Thu, 2 Dec 2021 00:47:14 -0800
Subject: [PATCH] btrfs: zoned: clear data relocation bg on zone finish
When finishing a zone that is used by a dedicated data relocation
block group, also remove its reference from fs_info, so we're not trying
to use a full block group for allocations during data relocation, which
will always fail.
The result is we're not making any forward progress and end up in a
deadlock situation.
Fixes: c2707a255623 ("btrfs: zoned: add a dedicated data relocation block group")
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 67d932d70798..678a29469511 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1860,6 +1860,7 @@ int btrfs_zone_finish(struct btrfs_block_group *block_group)
block_group->alloc_offset = block_group->zone_capacity;
block_group->free_space_ctl->free_space = 0;
btrfs_clear_treelog_bg(block_group);
+ btrfs_clear_data_reloc_bg(block_group);
spin_unlock(&block_group->lock);
ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_FINISH,
@@ -1942,6 +1943,7 @@ void btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 len
ASSERT(block_group->alloc_offset == block_group->zone_capacity);
ASSERT(block_group->free_space_ctl->free_space == 0);
btrfs_clear_treelog_bg(block_group);
+ btrfs_clear_data_reloc_bg(block_group);
spin_unlock(&block_group->lock);
map = block_group->physical_map;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] btrfs: zoned: clear data relocation bg on zone finish" failed to apply to 5.15-stable tree
2021-12-12 14:21 FAILED: patch "[PATCH] btrfs: zoned: clear data relocation bg on zone finish" failed to apply to 5.15-stable tree gregkh
@ 2021-12-13 7:34 ` Johannes Thumshirn
2021-12-13 8:22 ` gregkh
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2021-12-13 7:34 UTC (permalink / raw)
To: gregkh@linuxfoundation.org, dsterba@suse.com, Naohiro Aota
Cc: stable@vger.kernel.org
On 12/12/2021 15:21, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 5.15-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
Hi Greg,
this patch doesn't need any backporting to stable. The failure can only
happen on v5.16-rcX.
Thanks,
Johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] btrfs: zoned: clear data relocation bg on zone finish" failed to apply to 5.15-stable tree
2021-12-13 7:34 ` Johannes Thumshirn
@ 2021-12-13 8:22 ` gregkh
2021-12-13 9:04 ` Johannes Thumshirn
0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2021-12-13 8:22 UTC (permalink / raw)
To: Johannes Thumshirn; +Cc: dsterba@suse.com, Naohiro Aota, stable@vger.kernel.org
On Mon, Dec 13, 2021 at 07:34:37AM +0000, Johannes Thumshirn wrote:
> On 12/12/2021 15:21, gregkh@linuxfoundation.org wrote:
> >
> > The patch below does not apply to the 5.15-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> >
>
> Hi Greg,
>
> this patch doesn't need any backporting to stable. The failure can only
> happen on v5.16-rcX.
Really? The Fixes: tag says otherwise:
Fixes: c2707a255623 ("btrfs: zoned: add a dedicated data relocation block group")
as that commit id is in 5.15.4.
Perhaps that tag is incorrect?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] btrfs: zoned: clear data relocation bg on zone finish" failed to apply to 5.15-stable tree
2021-12-13 8:22 ` gregkh
@ 2021-12-13 9:04 ` Johannes Thumshirn
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2021-12-13 9:04 UTC (permalink / raw)
To: gregkh@linuxfoundation.org
Cc: dsterba@suse.com, Naohiro Aota, stable@vger.kernel.org
On 13/12/2021 09:22, gregkh@linuxfoundation.org wrote:
> On Mon, Dec 13, 2021 at 07:34:37AM +0000, Johannes Thumshirn wrote:
>> On 12/12/2021 15:21, gregkh@linuxfoundation.org wrote:
>>>
>>> The patch below does not apply to the 5.15-stable tree.
>>> If someone wants it applied there, or to any other stable or longterm
>>> tree, then please email the backport, including the original git commit
>>> id to <stable@vger.kernel.org>.
>>>
>>
>> Hi Greg,
>>
>> this patch doesn't need any backporting to stable. The failure can only
>> happen on v5.16-rcX.
>
> Really? The Fixes: tag says otherwise:
> Fixes: c2707a255623 ("btrfs: zoned: add a dedicated data relocation block group")
> as that commit id is in 5.15.4.
>
> Perhaps that tag is incorrect?
>
Nope, but 5.15.4 does not contain the functions where we forgot to add
the calls to btrfs_clear_data_reloc_bg().
The bug was a race between me and Naohiro working on c2707a255623 and
afba2bc036b0e ("btrfs: zoned: implement active zone tracking").
Thanks,
Johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-13 9:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-12 14:21 FAILED: patch "[PATCH] btrfs: zoned: clear data relocation bg on zone finish" failed to apply to 5.15-stable tree gregkh
2021-12-13 7:34 ` Johannes Thumshirn
2021-12-13 8:22 ` gregkh
2021-12-13 9:04 ` Johannes Thumshirn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox