Project

General

Profile

Actions

Bug #6253

closed

F_GETLK doesn't always return lock owner

Added by Arne Jansen almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2015-09-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

Issue #6225 describes a scenario where fcntl(F_GETLK) returns F_UNLCK even though F_SETLK declines the lock. This basically happens when one process holds a read lock while a second process waits for a write lock. Subsequent read lock requests fail, because the pending write lock blocks out new read locks to avoid write starvation.
flk_get_first_blocking_lock() is the function that determines the result of F_GETLK. For this, it only searches the list of all currently held locks. As this list contains only a read lock, it returns F_UNLCK.
To fix this, it's necessary to also search the list of pending locks to see if there is a write lock waiting.


Related issues

Related to illumos gate - Bug #6225: NFSv4: setlock() can spin foreverClosedMarcel Telka2015-09-12

Actions
Related to illumos gate - Bug #6016: Some file locking scenarios does not work as expectedNew2015-06-18

Actions
Actions

Also available in: Atom PDF