# Re: \[PATCH\] mdmonitor: check if udev has finished events processing

- From: Jes Sorensen \<hidden\>
- Date: 2021-03-08 15:23:53 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2021/03/6639958
- Thread: https://ratatoskr.run/linux-raid/2021/01/6639792/t.md

```text
On 1/14/21 9:14 AM, Oleksandr Shchirskyi wrote:
> If mdmonitor is awaken by event, wait for udev to finish
> events processing, to eliminate the race between udev and mdadm
> when spare has been added and need to be moved by mdmonitor
> 
> Signed-off-by: Oleksandr Shchirskyi <redacted>
> ---
>  Makefile  |  2 +-
>  Monitor.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++---------
>  2 files changed, 63 insertions(+), 12 deletions(-)

Hi,

I think it is reasonable to require libudev in 2021, so I have applied
this. However if someone feels there is a reason to not have this build
requirement, I will also accept a patch to make this dependency optional.

Second, I took the liberty to replace the ugly C++ style // comments
with proper /* */ ones.

Thanks,
Jes

```
