[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <25c23f9d-4fa0-4cad-9c96-43c25e018113@suse.de>
Date: Tue, 27 May 2025 10:54:00 +0200
From: Hannes Reinecke <hare@...e.de>
To: Yu Kuai <yukuai1@...weicloud.com>, hch@....de, xni@...hat.com,
colyli@...nel.org, song@...nel.org
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-raid@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com,
johnny.chenyi@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH 07/23] md/md-bitmap: delay registration of bitmap_ops
until creating bitmap
On 5/27/25 09:53, Yu Kuai wrote:
> Hi,
>
> 在 2025/05/27 14:13, Hannes Reinecke 写道:
>> On 5/24/25 08:13, Yu Kuai wrote:
>>> From: Yu Kuai <yukuai3@...wei.com>
>>>
>>> Currently bitmap_ops is registered while allocating mddev, this is fine
>>> when there is only one bitmap_ops, however, after introduing a new
>>> bitmap_ops, user space need a time window to choose which bitmap_ops to
>>> use while creating new array.
>>>
[ .. ]
>>> @@ -6093,11 +6104,6 @@ struct mddev *md_alloc(dev_t dev, char *name)
>>> return ERR_PTR(error);
>>> }
>>> - if (md_bitmap_registered(mddev) && mddev->bitmap_ops->group)
>>> - if (sysfs_create_group(&mddev->kobj, mddev->bitmap_ops->group))
>>> - pr_warn("md: cannot register extra bitmap attributes for
>>> %s\n",
>>> - mdname(mddev));
>>> -
>>> kobject_uevent(&mddev->kobj, KOBJ_ADD);
>>> mddev->sysfs_state = sysfs_get_dirent_safe(mddev->kobj.sd,
>>> "array_state");
>>> mddev->sysfs_level = sysfs_get_dirent_safe(mddev->kobj.sd,
>>> "level");
>>
>> But now you've killed udev event processing.
>> Once the 'add' event is sent _all_ sysfs attributes must be present,
>> otherwise you'll have a race condition where udev is checking for
>> attributes which are present only later.
>>
>> So when moving things around ensure to move the kobject_uevent() call,
>> too.
>
> I do not expect the bitmap entries are checked by udev, otherwise this
> set can introduce regressions since the bitmap entries are no longer
> existed after using the new biltmap.
>
> And the above KOBJ_ADD uevent is used for mddev->kobj, right? In this
> case, we're creating new entries under mddev->kobj, should this be
> KOBJ_CHANGE?
>
Yes, please.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +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
Powered by blists - more mailing lists