linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] btrfs: sysfs: bytes_zone_unusable is not under CONFIG_BTRFS_DEBUG
@ 2021-08-05  1:07 Anand Jain
  2021-08-12 15:59 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Anand Jain @ 2021-08-05  1:07 UTC (permalink / raw)
  To: linux-btrfs

Sysfs zoned file is under CONFIG_BTRFS_DEBUG (now there is a patch to
bring it under CONFIG_BLK_DEV_ZONED). But sysfs file bytes_zone_unusable
has escaped the CONFIG_BTRFS_DEBUG config. There is no problem with this
as bytes_zone_unusable with no zoned configured shall display 0, so it is
just a matter of fixing the consistency.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
RFC because in my understanding, there is no way to fix this
inconsistency without failing the ABI compliance test, so it is just
better to leave it as it is.

 fs/btrfs/sysfs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index cb00c0c08949..baef8f4b972e 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -702,7 +702,10 @@ SPACE_INFO_ATTR(bytes_pinned);
 SPACE_INFO_ATTR(bytes_reserved);
 SPACE_INFO_ATTR(bytes_may_use);
 SPACE_INFO_ATTR(bytes_readonly);
+/* Remove once support for zoned allocation is feature complete */
+#ifdef CONFIG_BTRFS_DEBUG
 SPACE_INFO_ATTR(bytes_zone_unusable);
+#endif
 SPACE_INFO_ATTR(disk_used);
 SPACE_INFO_ATTR(disk_total);
 
@@ -714,7 +717,9 @@ static struct attribute *space_info_attrs[] = {
 	BTRFS_ATTR_PTR(space_info, bytes_reserved),
 	BTRFS_ATTR_PTR(space_info, bytes_may_use),
 	BTRFS_ATTR_PTR(space_info, bytes_readonly),
+#ifdef CONFIG_BTRFS_DEBUG
 	BTRFS_ATTR_PTR(space_info, bytes_zone_unusable),
+#endif
 	BTRFS_ATTR_PTR(space_info, disk_used),
 	BTRFS_ATTR_PTR(space_info, disk_total),
 	NULL,
-- 
2.31.1


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

* Re: [PATCH RFC] btrfs: sysfs: bytes_zone_unusable is not under CONFIG_BTRFS_DEBUG
  2021-08-05  1:07 [PATCH RFC] btrfs: sysfs: bytes_zone_unusable is not under CONFIG_BTRFS_DEBUG Anand Jain
@ 2021-08-12 15:59 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2021-08-12 15:59 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Thu, Aug 05, 2021 at 09:07:00AM +0800, Anand Jain wrote:
> Sysfs zoned file is under CONFIG_BTRFS_DEBUG (now there is a patch to
> bring it under CONFIG_BLK_DEV_ZONED). But sysfs file bytes_zone_unusable
> has escaped the CONFIG_BTRFS_DEBUG config. There is no problem with this
> as bytes_zone_unusable with no zoned configured shall display 0, so it is
> just a matter of fixing the consistency.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> RFC because in my understanding, there is no way to fix this
> inconsistency without failing the ABI compliance test, so it is just
> better to leave it as it is.

Good find but I think we can keep it there unconditionally, that's the
long term plan. Hiding zoned mode behind debug option was meant only for
the beginning until the worst bugs are ironed out.

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

end of thread, other threads:[~2021-08-12 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05  1:07 [PATCH RFC] btrfs: sysfs: bytes_zone_unusable is not under CONFIG_BTRFS_DEBUG Anand Jain
2021-08-12 15:59 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).