mirror of
https://github.com/xcat2/xcat-dep.git
synced 2026-11-26 04:12:21 +00:00
b944a19782
t/nfslock_borrow_recovery.t asserts that a borrow with no metadata is NOT reclaimed, and t/nfslock.t stages one to prove a lock under another borrower is left alone. Both describe the permanent strand: the earlier protocol wrote no metadata into the borrow, so a taker killed there made the lock unacquirable for ever and no check objected. The protocol holds a metadata-less borrow for the time of two file reads, so one that two attempts find unchanged is held by nobody. The checks now assert that it is reclaimed, that a borrow touched between the attempts is not, and that a borrow whose metadata file exists but does not validate is not either - a half-finished write is still a partial read. A lock.d with no metadata is a different case and stays refused. Checks for it name the one condition under which the sweeper removes it, the caller's exclusive claim on the root. t/nfslock.t's live-borrower fixture now gives the borrow a live taker, which is what the lock must not be taken from. release returns early unless this process took the lock, so a forked child cannot free its parent's. No check covered that, and one now does. The workflow ran t/nfslock.t and not t/nfslock_borrow_recovery.t, so the new file was never run by the CI at all. It is on the list now. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>