mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-23 02:42:17 +00:00
db8f387fb5
Resyncs build-utils/lib/XCAT/NFSLock.pm with xcat-dep, where the defect was found and fixed. The module reclaimed a stranded lock.borrow by path after validating its metadata, and rmdir names a path and not the inode that was validated, so a contender stopped between the two steps removed whatever was at the path when it resumed. Two builds of one target could then both hold the build lock, which is the collision the lock exists to prevent. The borrow is numbered now, and a transition whose taker is provably dead is ended by creating the next generation rather than by removing the one that was validated. A process removes only a generation it created and still holds. acquire_lock_dir's comment said the retry budget covers reclaiming a borrow with no metadata over two attempts. That rule is withdrawn, because a live taker can pause for any length of time before its first write. A take-over needs one attempt; the budget leaves two for a contended lock. Depends on xcat-dep/#93, which carries the same change to the original. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>