Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Apr 2026 19:53:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 294832] lockf: does not block when locking on fd
Message-ID:  <bug-294832-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

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.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-294832-227>