Project

General

Profile

Bug #6253

F_GETLK doesn't always return lock owner

Added by Arne Jansen about 4 years ago. Updated about 4 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

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 foreverClosed2015-09-12

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

Actions

History

#1

Updated by Arne Jansen about 4 years ago

  • Related to Bug #6225: NFSv4: setlock() can spin forever added
#2

Updated by Arne Jansen about 4 years ago

  • Related to Bug #6016: Some file locking scenarios does not work as expected added
#3

Updated by Electric Monk about 4 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>

#4

Updated by Marcel Telka about 4 years ago

  • Category set to kernel
  • Assignee set to Arne Jansen

Also available in: Atom PDF