On 7/8/25 13:31, 余快 wrote:
Hi,
Hannes Reinecke <hare@xxxxxxx <mailto:hare@xxxxxxx>> 于2025年7月8日周二
14:29写道:
> + if (mddev->bitmap_ops->group && !mddev_is_dm(mddev)) {
> + if (sysfs_create_group(&mddev->kobj, mddev-
>bitmap_ops->group))
> + pr_warn("md: cannot register extra bitmap
attributes for %s\n",
> + mdname(mddev));
> + else
> + kobject_uevent(&mddev->kobj, KOBJ_CHANGE);
> + }
> return true;
>
> err:
Ouch. This will cause havoc with the udev rules.
Having different events for 'add' and 'change' tends to confuse udev
rules (most treat 'add' and 'change' identically), so at the very least
you would need to document this.
Do you mean document here as new sysfs entries are created under mddev
kobject?
No, I meant to document that 'add' events will have access to different
sysfs attributes than the 'change' events.
In the running system one will only see the final status, so it's not
immediately obvious that some attributes are only valid for 'change',
and not for 'add'.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich