flock will not block inotify or udev events being emitted.

See
https://github.com/systemd/systemd/blob/master/src/udev/udevd.c#L322
https://github.com/systemd/systemd/blob/master/src/udev/udevd.c#L409

it will prevent udevd from running the rules against it. Thus
effectively the event will be fired and done, but nothing actually
executed for it.

" /* apply rules, create node, symlinks */"

Also, most importantly udevd also takes locks on devices, thus if one
cannot take a lock on it, it means it shouldn't be touched yet as udevd
is still processing it.

Yeah, i read code and ioctls both call, and I have no idea which one is
better, or what the difference is. If partx works, cool. But also, I
thought udev should be updating partition tables all by itself. I
somehow wonder if we even need partx call, if we properly flock the
device and trigger udev after everything is done.

Udev rules should be safe to be retriggered like that. But also, we
should retrigger the expected events which have been skipped. So does
growpart create partition? move it? delete/recreate one? i.e does ADD
happen? or like REMOVE & ADD? or maybe it's like just MOVE or CHANGE? Do
we have logs of the emitted events already?

Don't like flags, as then we'll have to supported forever =) maybe env
variable? or like simply change in focal and compare focal vs eoan?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1834875

Title:
  cloud-init growpart race with udev

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1834875/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to