Fcntl(..., F GETLK, ...) does not return correct info about a read lock which is set on server

From Linux NFS

Revision as of 19:30, 29 July 2011 by Amschuma (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


  • Kernel version: 2.6.22-rc1 and higher
  • Bug 23892
  • Reported by: Alexander Morozov (November 28, 2010)
  • Fixed by: Florain Mickler (January 23, 2010)

How to reproduce

  • Environment:
Debian Lenny with kernel 2.6.37-rc3 i686
nfs-common         1:1.1.2-6lenny2
nfs-kernel-server  1:1.1.2-6lenny2 is a server is a client
  • /etc/exports on a server:
  • Steps to reproduce:
client# mount -t nfs /srv/test

server$ cd /srv/test
server$ ./linlock r file
press Ctrl-C...

client$ cd /srv/test
client$ ./linlock w file
fcntl: Resource temporary unavailable
client$ ./lockinfo file
F_UNLCK SEEK_SET start 0 len 0
  • ./linlock tool set read (r) or write (w) lock on a file.
  • ./lockinfo shows what F_GETLK returns. This test shows that a client can not set a write lock on a read lock of server but F_GETLK tells that file is not locked.
  • The bug does not occur if client with 2.6.21 kernel.
  • The bug occurs if client with 2.6.22-rc1 and higher.
Personal tools