[systemd-devel] [PATCH] udev: Restore udevadm settle timeout

David Herrmann dh.herrmann at gmail.com
Thu May 7 02:23:49 PDT 2015


Hi

On Thu, May 7, 2015 at 10:53 AM, Harald Hoyer <harald.hoyer at gmail.com> wrote:
> On 20.04.2015 10:33, David Herrmann wrote:
>> Hi
>>
>> On Sat, Apr 11, 2015 at 9:38 PM, Nir Soffer <nirsof at gmail.com> wrote:
>>> On Sat, Apr 11, 2015 at 1:36 PM, David Herrmann <dh.herrmann at gmail.com> wrote:
>>>>> @@ -139,6 +142,9 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
>>>>>                          break;
>>>>>                  }
>>>>>
>>>>> +                if (now(CLOCK_MONOTONIC) >= deadline)
>>>>> +                        break;
>>>>> +
>>>>
>>>> Previous udevadm allowed timeout=0 to disable this. I added the condition.
>>>
>>> Hi David,
>>>
>>> I think the handling of timeout=0 is incorrect now. The manual says:
>>>
>>>     A value of 0 will check if the queue is empty and always return
>>>     immediately.
>>>
>>> In udev-147 (used on rhel6), this was the behavior. If timeout was 0,
>>> is_timeout was set and settle was returning with rc=1.
>>>
>>> This behavior changed in:
>>>
>>> http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=ead7c62ab7641e150c6d668f939c102a6771ce60
>>>
>>> After this commit, zero timeout results in unlimited wait. Since this
>>> patch did not
>>> change the manual or the online help, and the commit message says:
>>> "udevadm: settle - kill alarm()", I guess this was unintended change.
>>>
>>> I don't see the use case for disabling the timeout, so it seems that
>>> we should fix
>>> this, restoring the behavior before this commit.
>>>
>>> What do you think?
>>
>> Ok, this is on me, sorry for that. I tried to keep the behavior from
>> before the code-removal. I wasn't aware that this was not how it is
>> documented.
>>
>> I'm actually not sure whether that was an intended change. It does not
>> look like it was, indeed. Maybe Kay or Tom know more.. I have no idea
>> whether timeout=0 is used in the wild.
>>
>
>
> Oh, dracut makes use of "udevadm settle --timeout=0" all the time

--timeout was ignored for udevadm-settle since 213, effectively
running with an infinite timeout under all circumstances. This was a
regression of:
"udev: remove seqnum API and all assumptions about seqnums" (commit 9ea28c55)

The 3 fixes to make --timeout work properly again, are:
"udev: restore udevadm settle timeout" (commit 0736455b)
"udev: settle should return immediately when timeout is 0" (commit bf23b9f8)
"udev: Fix ping timeout when settle timeout is 0" (commit 7375b3c4)

All are queued up for 219.

Thanks
David


More information about the systemd-devel mailing list