All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>,
	dsterba@suse.cz, David Sterba <dsterba@suse.com>,
	johannes.thumshirn@wdc.com, damien.lemoal@wdc.com,
	naohiro.aota@wdc.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: sysfs: advertise zoned support among features
Date: Thu, 19 Aug 2021 19:30:20 +0800	[thread overview]
Message-ID: <32a3cf04-580c-7eec-3a74-c005c212940a@oracle.com> (raw)
In-Reply-To: <27dc7b6a-ff20-2384-43b0-ffb67b62e37b@oracle.com>



On 19/08/2021 19:16, Anand Jain wrote:
> 
> 
> On 19/08/2021 17:14, Nikolay Borisov wrote:
>>
>>
>> On 19.08.21 г. 12:08, Nikolay Borisov wrote:
>>>
>>>
>>> On 19.08.21 г. 2:48, David Sterba wrote:
>>>> On Tue, Aug 10, 2021 at 08:30:51AM +0800, Anand Jain wrote:
>>>>>    As in the proposed patch which adds a table to figure out the 
>>>>> correct
>>>>> table to add the attribute, adding to the
>>>>> btrfs_supported_static_feature_attrs attribute list will add only to
>>>>> /sys/fs/btrfs/features, however adding the attribute to
>>>>> btrfs_supported_feature_attrs adds to both /sys/fs/btrfs/features and
>>>>> /sys/fs/btrfs/uuid/features.
>>>>
>>>> I can't see it in the code right now, but that would mean that eg. 
>>>> zoned
>>>> would show up in static features once such filesystem is mounted. And
>>>> that does not happen or I'm missing something.
>>>>
>>>
>>> This happens because when initialising sysfs we create the
>>> btrfs_feature_attr_group which contains btrfs_supported_feature_attrs
>>> attributes, which have
>>> #ifdef CONFIG_BLK_DEV_ZONED
>>>
>>>           BTRFS_FEAT_ATTR_PTR(zoned),
>>>
>>> #endif
>>>
>>> Subsequently you define the static feature via
>>> BTRFS_ATTR(static_feature, zoned, zoned_show);
>>>
>>> and finally we call:
>>>
>>> ret = sysfs_merge_group(&btrfs_kset->kobj,
>>> &btrfs_static_feature_attr_group);
>>>
>>>
>>> Which merges the static feature to the feature group. That's why the
>>> message about duplication. So one of the 2 definitions needs to go.
>>>
>>
>> Looking at the maze that btrfs' sysfs code is it seems the decision
> 
> 
>> which of the two sets to use when defining a feature is whether it can
> 
> ...be enabled per fsid.
> ::
> 
>> I think for zoned block device we can't
>> really disable the support at runtime?
> 
>   Hmm. It is not like that. Suppose there are two btrfs filesystems on a
>   system fsid1 and fsid2.  fsid1 is zoned. fsid2 is a normal conventional
>   device. Then on fsid1 zoned incompatible feature/flag is enabled and,
>   on fsid2 it is not enabled.
> 
>   So IMO zoned should be added to btrfs_supported_feature_attrs.

   Provided /sys/fs/btrfs/feature/zoned will return nothing in specific 
values like sectorsize.

> 
>   By doing this,
>   on /sys/fs/btrfs/feature zoned is shown
>   on /sys/fs/btrfs/fsid1/feature zoned is shown
>   on /sys/fs/btrfs/faid2/feature zoned is NOT shown
> 
>   btrfs_feature_visible() and get_features() manages to do that
>   dynamically.
> 
> 
>> If so then it needs to only be
>> defined as a static feature?
> 
>   No. pls.
> 
>> Just because the kernel supports it doesn't
>> necessarily mean it's going to be used if the underlying device is not
>> zoned, right, it should depend on the runtime characteristics of the
>> underlying device?
> 
>   Right. As in the above example. Imagine runtime == mkfs time in this
>   context, so to say.
> 

  reply	other threads:[~2021-08-19 11:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 16:56 [PATCH] btrfs: sysfs: advertise zoned support among features David Sterba
2021-08-05  0:13 ` Anand Jain
2021-08-09  9:19   ` David Sterba
2021-08-10  0:30     ` Anand Jain
2021-08-18 23:48       ` David Sterba
2021-08-19  9:08         ` Nikolay Borisov
2021-08-19  9:14           ` Nikolay Borisov
2021-08-19 11:16             ` Anand Jain
2021-08-19 11:30               ` Anand Jain [this message]
2021-08-19  9:21 ` Nikolay Borisov
2021-08-19  9:31   ` Damien Le Moal
2021-08-19  9:37     ` Nikolay Borisov
2021-08-19  9:45       ` Damien Le Moal
2022-06-06 16:36 David Sterba
2022-06-15 12:26 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32a3cf04-580c-7eec-3a74-c005c212940a@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.