mbox series

[0/2] btrfs: zoned: fix zone activation logic

Message ID cover.1651611385.git.naohiro.aota@wdc.com (mailing list archive)
Headers show
Series btrfs: zoned: fix zone activation logic | expand

Message

Naohiro Aota May 3, 2022, 9:10 p.m. UTC
btrfs_zone_activate() "continue"s on seeing a devie without max_active_zone
restriction, and it never set the block group as active if the block group
does not contain a device with the restriction.

While it still return true and make the allocation works, it is confusing
for other code and it is waste of time to iterate the loop every time
btrfs_zone_activate() is called.

Also, there is a non-changing condition check in the loop.

Fix them with this series.

Naohiro Aota (2):
  btrfs: zoned: move non-changing condition check out of the loop
  btrfs: zoned: activate block group properly on unlimited active zone
    device

 fs/btrfs/zoned.c | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

Comments

Johannes Thumshirn May 3, 2022, 10:09 p.m. UTC | #1
Oops I'm sorry.

For the series,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
David Sterba May 4, 2022, 4:55 p.m. UTC | #2
On Tue, May 03, 2022 at 02:10:03PM -0700, Naohiro Aota wrote:
> btrfs_zone_activate() "continue"s on seeing a devie without max_active_zone
> restriction, and it never set the block group as active if the block group
> does not contain a device with the restriction.
> 
> While it still return true and make the allocation works, it is confusing
> for other code and it is waste of time to iterate the loop every time
> btrfs_zone_activate() is called.
> 
> Also, there is a non-changing condition check in the loop.
> 
> Fix them with this series.
> 
> Naohiro Aota (2):
>   btrfs: zoned: move non-changing condition check out of the loop
>   btrfs: zoned: activate block group properly on unlimited active zone
>     device

There's a minor conflict with the other series fixing the zone finish
but this 2 patch series is a clear regression so I'll take it first for
rc, not sure about the other yet.
Naohiro Aota May 4, 2022, 6:46 p.m. UTC | #3
On Wed, May 04, 2022 at 06:55:59PM +0200, David Sterba wrote:
> On Tue, May 03, 2022 at 02:10:03PM -0700, Naohiro Aota wrote:
> > btrfs_zone_activate() "continue"s on seeing a devie without max_active_zone
> > restriction, and it never set the block group as active if the block group
> > does not contain a device with the restriction.
> > 
> > While it still return true and make the allocation works, it is confusing
> > for other code and it is waste of time to iterate the loop every time
> > btrfs_zone_activate() is called.
> > 
> > Also, there is a non-changing condition check in the loop.
> > 
> > Fix them with this series.
> > 
> > Naohiro Aota (2):
> >   btrfs: zoned: move non-changing condition check out of the loop
> >   btrfs: zoned: activate block group properly on unlimited active zone
> >     device
> 
> There's a minor conflict with the other series fixing the zone finish
> but this 2 patch series is a clear regression so I'll take it first for
> rc, not sure about the other yet.

Oh, sorry for confusion. As noted in "btrfs: zoned: fixes for zone
finishing" series, that series depends on this series as they both touch
the btrfs_zone_activate() function.