From: Stefan Roesch <shr@fb.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
"kernel-team@fb.com" <kernel-team@fb.com>
Cc: Naohiro Aota <Naohiro.Aota@wdc.com>
Subject: Re: [PATCH] btrfs: sysfs: set / query btrfs stripe size
Date: Wed, 27 Oct 2021 00:19:18 -0700 [thread overview]
Message-ID: <44bf1de4-53fd-74e8-a204-ce12e33722c5@fb.com> (raw)
In-Reply-To: <PH0PR04MB74165DE04219D13232F3D9CE9B859@PH0PR04MB7416.namprd04.prod.outlook.com>
On 10/27/21 12:09 AM, Johannes Thumshirn wrote:
> On 27/10/2021 08:59, Stefan Roesch wrote:
> [...]
>>>> static ssize_t btrfs_stripe_size_show(struct kobject *kobj,
>>>> struct kobj_attribute *a, char *buf)
>>>>
>>>> {
>>>> struct btrfs_space_info *sinfo = to_space_info(kobj);
>>>> struct btrfs_fs_info *fs_info = to_fs_info(get_btrfs_kobj(kobj));
>>>> u64 max_stripe_size;
>>>>
>>>> spin_lock(&sinfo->lock);
>>>> if (btrfs_is_zoned(fs_info))
>>>> max_stripe_size = fs_info->zone_size;
>>>> else
>>>> max_stripe_size = sinfo->max_stripe_size;
>>>> spin_unlock(&sinfo->lock);
>>>
>>> This will not work once we have stripped zoned volume though, won't it ?
>>> Why is not max_stripe_size set to zone size for a simple zoned btrfs volume ?
>>>
>>
>> My intention was to not support zoned volumes with this patch. However I missed
>> the correct check in the function btrfs_stripe_size_show. The intent was to return
>> -EINVAL for zoned volumes.
>>
>> Any thoughts?
>
> Hi Stefan,
>
> struct btrfs_fs_info *fs_info = to_fs_info(get_btrfs_kobj(kobj));
>
> if (btrfs_is_zoned(fs_info))
> return -EINVAL;
>
> But why not just set the correct values for a zoned dev and show them?
> You can still not allow setting new values.
>
The code you proposed above is what I already have in my local commit.
I can change the code to initialize the stripe size to use the zone size
for zoned volumes. Then we don't need the above if clause.
Damien mentioned that this should only be done for simple zoned btrfs volumes.
How do I find out if this is a simple zoned volume?
next prev parent reply other threads:[~2021-10-27 7:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 16:59 [PATCH] btrfs: sysfs: set / query btrfs stripe size Stefan Roesch
2021-10-26 18:08 ` Hugo Mills
2021-10-26 18:29 ` Josef Bacik
2021-10-27 6:28 ` Johannes Thumshirn
2021-10-27 6:51 ` Damien Le Moal
2021-10-27 6:58 ` Stefan Roesch
2021-10-27 7:09 ` Johannes Thumshirn
2021-10-27 7:19 ` Stefan Roesch [this message]
2021-10-27 7:37 ` Johannes Thumshirn
2021-10-27 7:20 ` Johannes Thumshirn
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=44bf1de4-53fd-74e8-a204-ce12e33722c5@fb.com \
--to=shr@fb.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=Naohiro.Aota@wdc.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox