# Re: \[PATCH 2/2\] Manage: Inform udev about device removal when stopping

- From: Jes Sorensen \<hidden\>
- Date: 2016-02-17 17:33:08 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2016/02/6631604
- Thread: https://ratatoskr.run/linux-raid/2016/02/6631604/t.md

```text
Sebastian Parschauer [ref] writes:
> On 17.02.2016 14:06, Jes Sorensen wrote:
>> Hannes Reinecke [ref] writes:
>>> On 02/16/2016 09:46 PM, NeilBrown wrote:
>>>> On Wed, Feb 17 2016, Jes Sorensen wrote:
>>>>>
>>>>> I am totally fine with this, however we should make mdadm
>>>>> fail if run against a pre-2.6.28 kernel then.
>>>>>
>>>>> Cheers, Jes
>>>>
>>>> I would suggest protecting the
>>>>
>>>> if (fd >= 0) ioctl(fd, BLKRRPART, 0); if (mdi) 
>>>> sysfs_uevent(mdi, "change");
>>>>
>>>> code with
>>>>
>>>> if (get_linux_version() < 2006028)
>>>>
>>>> That should be completely safe - 2.6.28 and later do this (if
>>>> needed).
>>>>
>>> +1.
>>>
>>> Yes, this is the best solution.
>> 
>> Sebastian indicates it only works if the kernel patch he submitted is
>> applied too - should we tweak the mdadm version check to match the next
>> upstream kernel, or stick with it as is here?
>
> Sorry, it also works if dropping the sending of the change event in the
> kernel as well. This seems to be the preferred solution so far. So for
> kernels still sending the change event, the problem is not fixed this
> way. But your mdadm commit also doesn't make it worse.

Since there is pretty broad agreement on this approach, I have pushed
the fix out for mdadm.

Jes
```
