On 9/15/20 7:33 AM, Nix wrote: > On 9 Sep 2020, Mariusz Tkaczyk uttered the following: > >> + /* >> + * If mdmonitor is awaken by event, set small delay once >> + * to deal with udev and mdadm. >> + */ >> + if (wait_result != 0) { >> + if (c->delay > 5) >> + delay_for_event = 5; >> + } else >> + delay_for_event = c->delay; > > This is racy: if any delay is needed, any finite delay value will > now and then be too short. > > I think this should be fixed by arranging for mdmonitor to be signalled > when udev or whatever has finished whatever it's doing. (udev has lots > of ways it could be asked to do that.) > Hi I have applied this patch for now, since it is better than what we had. However, I agree it would be better to do this using udev or other signalling, so please have a look at that. Cheers, Jes