Re: [PATCH] btrfs: sysfs: set / query btrfs stripe size
From: Johannes Thumshirn <hidden>
Date: 2021-10-27 07:09:16
On 27/10/2021 08:59, Stefan Roesch wrote: [...]
quoted
quoted
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.