On Tue, Dec 19, 2023 at 04:14:40PM +0100, Phil Sutter wrote: > On Tue, Dec 19, 2023 at 03:08:55AM +0100, Phil Sutter wrote: > > Parameter 'wait' passed to xtables_lock() signals three modes of > > operation, depending on its value: > > > > -1: --wait not specified, do not wait if lock is busy > > 0: --wait specified without value, wait indefinitely until lock becomes > > free > > These two are actually the other way round: 'wait' is zero if no '-w' > was specified and -1 if given without timeout. Sorry for the confusion! > > > >0: Wait for 'wait' seconds for lock to become free, abort otherwise > > > > Since fixed commit, the first two cases were treated the same apart from > > calling alarm(0), but that is a nop if no alarm is pending. Fix the code > > by requesting a non-blocking flock() in the second case. While at it, > > restrict the alarm setup to the third case only. > > > > Cc: Jethro Beekman <jethro@xxxxxxxxxxxx> > > Cc: howardjohn@xxxxxxxxxx > > Cc: Antonio Ojea <antonio.ojea.garcia@xxxxxxxxx> > > Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1728 > > Fixes: 07e2107ef0cbc ("xshared: Implement xtables lock timeout using signals") > > Signed-off-by: Phil Sutter <phil@xxxxxx> Patch applied after fixing up the above typo.