Bug 94258 - [rpc] O_NONBLOCK may block with rpc.lockd
Summary: [rpc] O_NONBLOCK may block with rpc.lockd
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 6.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-09 02:40 UTC by Kris Kennaway
Modified: 2017-12-31 22:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kris Kennaway 2006-03-09 02:40:07 UTC
When the rpc.lockd server is unreachable, locks acquired with
O_NONBLOCK may block.  They also block for a few minutes after
rpc.lockd is restarted, but they eventually complete.

Fix: 

Unsure.  Returning EWOULDBLOCK may not be correct since this means

     [EWOULDBLOCK]      O_NONBLOCK and one of O_SHLOCK or O_EXLOCK is speci-
                        fied and the file is locked.

and the file may or may not be locked.  Perhaps blocking is even
correct behaviour according to the relevant standards, though this is
counter-intuitive.
How-To-Repeat: 
On the server:

dosirak# killall -KILL rpc.lockd

On the client:

haessal# lockf -t 0 -k pid echo Yay
load: 0.00  cmd: lockf 1467 [lockd] 0.00u 0.00s 0% 528k
[hangs forever]

After rpc.lockd is restarted, it still takes a few minutes for the
lock operation to complete successfully.  New locks acquired in this
period also block.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:08 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped