Page MenuHomeFreeBSD

lockf: Avoid spinning when operating on an fd
ClosedPublic

Authored by des on Apr 29 2026, 10:50 PM.
Tags
None
Referenced Files
F160423265: D56722.diff
Wed, Jun 24, 7:52 AM
Unknown Object (File)
Fri, Jun 5, 9:23 PM
Unknown Object (File)
Mon, Jun 1, 11:31 PM
Unknown Object (File)
Mon, Jun 1, 11:25 PM
Unknown Object (File)
Mon, Jun 1, 1:17 PM
Unknown Object (File)
Mon, Jun 1, 1:12 PM
Unknown Object (File)
Mon, Jun 1, 12:33 PM
Unknown Object (File)
Mon, Jun 1, 12:23 PM
Subscribers

Details

Summary

When operating on a file descriptor, acquire_lock() would ignore the
flags argument and always operate in non-blocking mode, resulting in
unnecessary busy-looping.

PR: 294832
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Apr 29 2026, 10:50 PM
markj added a subscriber: markj.
markj added inline comments.
usr.bin/lockf/lockf.c
322–324

Better would be to declare lflags in this block, it's only used there.

This revision is now accepted and ready to land.May 2 2026, 5:28 PM
This revision now requires review to proceed.May 2 2026, 6:52 PM
This revision is now accepted and ready to land.May 3 2026, 3:25 PM