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
Unknown Object (File)
Fri, Sep 11, 3:43 AM
Unknown Object (File)
Thu, Sep 10, 9:55 AM
Unknown Object (File)
Tue, Sep 8, 12:50 AM
Unknown Object (File)
Sat, Sep 5, 3:16 AM
Unknown Object (File)
Sat, Sep 5, 12:39 AM
Unknown Object (File)
Fri, Sep 4, 7:43 PM
Unknown Object (File)
Fri, Sep 4, 7:20 PM
Unknown Object (File)
Fri, Sep 4, 6:18 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 72645
Build 69528: arc lint + arc unit

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

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