Actions
Bug #6253
closedF_GETLK doesn't always return lock owner
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
Updated by Arne Jansen almost 7 years ago
- Related to Bug #6225: NFSv4: setlock() can spin forever added
Updated by Arne Jansen almost 7 years ago
- Related to Bug #6016: Some file locking scenarios does not work as expected added
Updated by Electric Monk almost 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit b584d06cf5d63c0af8a641ca543c28986ec5cf81
commit b584d06cf5d63c0af8a641ca543c28986ec5cf81 Author: Arne Jansen <sensille@gmx.net> Date: 2015-09-22T13:50:05.000Z 6253 F_GETLK doesn't always return lock owner Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Simon Klinkert <simon.klinkert@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com>
Updated by Marcel Telka almost 7 years ago
- Category set to kernel
- Assignee set to Arne Jansen
Actions