Alfred, I took a look at retry_blockingfilelocklist() and the
solution seemed simple enough. Please correct me if I am wrong.
It seems said routine doesn't take into account boundary conditions
when putting back file_lock entries into the blocked lock-list.
Specifically, it fails when the file_lock being put back is the
last element in the list, and when it is the only element in the
list. I've included a patch below.
Basically, it introduces another variable: pfl, which keeps track
of the list item before ifl. That way if nfl is NULL, ifl gets
inserted after pfl. If pfl is also NULL, then it gets inserted
at the head of the list (since it was the only element in the
list).
Submitted by: Mike Makonnen <mike_makonnen@yahoo.com>
Tested by: Thomas Quinot <thomas@cuivre.fr.eu.org>
file is still completely covered by a flock(2) style lock, but we'll tackle
that at a later date.
Submitted by: "Andrew P. Lentvorski" <bsder@allcaps.org>
use LIST_FOREACH,
add prototypes (functions should be made static probably),
change DEBUG=1 to LOCKD_DEBUG,
K&R function instantiation for functions with long args lists,
Move comments about functions from within to above the function,
Simplified some if/else logic and reduced nested blocks.
parens around 'return' argument (return FOO -> return (FOO))
of the rpc.lockd fully compliant with the old file locking semantics.
Andrew will dig into the statd code next and then will attack the split
locking.
This also backs out a lot of the work I've done on making the code
more conformant with non-written style rules, but we'll revisit that
later.
Submitted by: "Andrew P. Lentvorski" <bsder@allcaps.org>