[systemd-devel] [PATCH 1/2] md: Inform udev about device removal when stopping

Shaohua Li shli at kernel.org
Tue Feb 16 20:05:53 UTC 2016


On Tue, Feb 16, 2016 at 03:44:36PM +0100, Sebastian Parschauer wrote:
> When stopping an MD device, then its device node /dev/mdX may still
> exist afterwards or it is recreated by udev. The next open() call
> can lead to creation of an inoperable MD device. The reason for
> this is that a change event (KOBJ_CHANGE) is announced to udev.
> So announce a removal event (KOBJ_REMOVE) to udev instead.
> 
> A change is likely also required in mdadm because of the support
> for kernels prior to 2.6.28.

I didn't follow why we need the change. Shouldn't the KOBJ_REMOVE event be sent
automatically when gendisk is deleted?
mddev_put()->mddev_delayed_delete()->md_free()->del_gendisk().

Thanks,
Shaohua


More information about the systemd-devel mailing list