[Bug 294832] lockf: does not block when locking on fd
Date: Mon, 27 Apr 2026 19:53:33 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294832
Bug ID: 294832
Summary: lockf: does not block when locking on fd
Product: Base System
Version: Unspecified
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: bin
Assignee: bugs@FreeBSD.org
Reporter: chris@chrullrich.net
When lockf(1) is not set to delete the lock file upon releasing the lock, it
should block in the flock() call for performance reasons.
This is also the case when it is operating on an fd to an existing file. The
acquire_lock() function, however, does not consider whether blocking or
non-blocking mode is requested in the fdlock branch.
On one of my systems this behavior burns ~50 % CPU time according to top when a
shell script uses lockf to serialize with another instance of itself.
--
You are receiving this mail because:
You are the assignee for the bug.