public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: zoned: exit btrfs_can_activate_zone if BTRFS_FS_NEED_ZONE_FINISH is set
@ 2025-02-12 14:05 Johannes Thumshirn
  2025-02-17  2:42 ` Naohiro Aota
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Thumshirn @ 2025-02-12 14:05 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Naohiro Aota, Johannes Thumshirn, Chris Mason, Josef Bacik,
	David Sterba, open list

From: Johannes Thumshirn <johannes.thumshirn@wdc.com>

If BTRFS_FS_NEED_ZONE_FINISH is already set for the whole filesystem, exit
early in btrfs_can_activate_zone(). There's no need to check if
BTRFS_FS_NEED_ZONE_FINISH needs to be set if it is already set.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/zoned.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 73e0aa9fc08a..4956baf8220a 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2325,6 +2325,9 @@ bool btrfs_can_activate_zone(struct btrfs_fs_devices *fs_devices, u64 flags)
 	if (!btrfs_is_zoned(fs_info))
 		return true;
 
+	if (test_bit(BTRFS_FS_NEED_ZONE_FINISH, &fs_info->flags))
+		return false;
+
 	/* Check if there is a device with active zones left */
 	mutex_lock(&fs_info->chunk_mutex);
 	spin_lock(&fs_info->zone_active_bgs_lock);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs: zoned: exit btrfs_can_activate_zone if BTRFS_FS_NEED_ZONE_FINISH is set
  2025-02-12 14:05 [PATCH] btrfs: zoned: exit btrfs_can_activate_zone if BTRFS_FS_NEED_ZONE_FINISH is set Johannes Thumshirn
@ 2025-02-17  2:42 ` Naohiro Aota
  0 siblings, 0 replies; 2+ messages in thread
From: Naohiro Aota @ 2025-02-17  2:42 UTC (permalink / raw)
  To: Johannes Thumshirn, linux-btrfs@vger.kernel.org
  Cc: Johannes Thumshirn, Chris Mason, Josef Bacik, David Sterba,
	open list

On Wed Feb 12, 2025 at 11:05 PM JST, Johannes Thumshirn wrote:
> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>
> If BTRFS_FS_NEED_ZONE_FINISH is already set for the whole filesystem, exit
> early in btrfs_can_activate_zone(). There's no need to check if
> BTRFS_FS_NEED_ZONE_FINISH needs to be set if it is already set.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  fs/btrfs/zoned.c | 3 +++
>  1 file changed, 3 insertions(+)

Looks reasonable.

Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-17  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 14:05 [PATCH] btrfs: zoned: exit btrfs_can_activate_zone if BTRFS_FS_NEED_ZONE_FINISH is set Johannes Thumshirn
2025-02-17  2:42 ` Naohiro Aota

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox