1
linux/fs/nfs
Suresh Jayaraman 5eebde2322 nfs: introduce mount option '-olocal_lock' to make locks local
NFS clients since 2.6.12 support flock locks by emulating fcntl byte-range
locks. Due to this, some windows applications which seem to use both flock
(share mode lock mapped as flock by Samba) and fcntl locks sequentially on
the same file, can't lock as they falsely assume the file is already locked.
The problem was reported on a setup with windows clients accessing excel files
on a Samba exported share which is originally a NFS mount from a NetApp filer.

Older NFS clients (< 2.6.12) did not see this problem as flock locks were
considered local. To support legacy flock behavior, this patch adds a mount
option "-olocal_lock=" which can take the following values:

   'none'  		- Neither flock locks nor POSIX locks are local
   'flock' 		- flock locks are local
   'posix' 		- fcntl/POSIX locks are local
   'all'		- Both flock locks and POSIX locks are local

Testing:

   - This patch was tested by using -olocal_lock option with different values
     and the NLM calls were noted from the network packet captured.

     'none'  - NLM calls were seen during both flock() and fcntl(), flock lock
   	       was granted, fcntl was denied
     'flock' - no NLM calls for flock(), NLM call was seen for fcntl(),
   	       granted
     'posix' - NLM call was seen for flock() - granted, no NLM call for fcntl()
     'all'   - no NLM calls were seen during both flock() and fcntl()

   - No bugs were seen during NFSv4 locking/unlocking in general and NFSv4
     reboot recovery.

Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2010-09-23 08:55:58 -04:00
..
cache_lib.c
cache_lib.h
callback_proc.c NFS: Fix the locking in nfs4_callback_getattr 2010-08-06 13:41:39 -04:00
callback_xdr.c
callback.c param: use ops in struct kernel_param, rather than get and set fns directly 2010-08-11 23:04:13 +09:30
callback.h
client.c nfs: introduce mount option '-olocal_lock' to make locks local 2010-09-23 08:55:58 -04:00
delegation.c NFS: Clean up the callers of nfs_wb_all() 2010-08-03 22:06:40 -04:00
delegation.h NFSv41: Fix nfs_async_inode_return_delegation() ugliness 2010-06-22 13:24:02 -04:00
dir.c nfs: move nfs_sillyrename to unlink.c 2010-09-17 17:31:30 -04:00
direct.c NFSv4: Ensure that we track the NFSv4 lock state in read/write requests. 2010-07-30 14:41:56 -04:00
dns_resolve.c NFS: Use kernel DNS resolver [ver #2] 2010-08-11 17:11:28 +00:00
dns_resolve.h NFS: Use kernel DNS resolver [ver #2] 2010-08-11 17:11:28 +00:00
file.c nfs: introduce mount option '-olocal_lock' to make locks local 2010-09-23 08:55:58 -04:00
fscache-index.c
fscache.c
fscache.h
getroot.c
idmap.c
inode.c NFS: Convert nfsiod to use alloc_workqueue() 2010-09-21 16:55:31 -04:00
internal.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-08-10 11:26:52 -07:00
iostat.h
Kconfig Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2010-08-18 15:45:23 -07:00
Makefile
mount_clnt.c NFS: Remove \t from mount debugging message 2010-09-17 10:54:37 -04:00
namespace.c
nfs2xdr.c SUNRPC: Refactor logic to NUL-terminate strings in pages 2010-09-21 16:55:48 -04:00
nfs3acl.c
nfs3proc.c NFS: Fix NFSv3 debugging messages in fs/nfs/nfs3proc.c 2010-09-21 16:55:47 -04:00
nfs3xdr.c SUNRPC: Refactor logic to NUL-terminate strings in pages 2010-09-21 16:55:48 -04:00
nfs4_fs.h NFS: Add an 'open_context' element to struct nfs_rpc_ops 2010-09-17 10:56:51 -04:00
nfs4namespace.c
nfs4proc.c NFSv4.1: Fix the slotid initialisation in nfs_async_rename() 2010-09-21 16:52:40 -04:00
nfs4renewd.c NFSv41: Convert the various reboot recovery ops etc to minor version ops 2010-06-22 13:24:02 -04:00
nfs4state.c NFSv4: Ensure the lockowners are labelled using the fl_owner and/or fl_pid 2010-07-30 14:46:10 -04:00
nfs4xdr.c SUNRPC: Refactor logic to NUL-terminate strings in pages 2010-09-21 16:55:48 -04:00
nfsroot.c NFS: Allow NFSROOT debugging messages to be enabled dynamically 2010-09-17 10:54:37 -04:00
pagelist.c NFSv4: Ensure that we track the NFSv4 lock state in read/write requests. 2010-07-30 14:41:56 -04:00
proc.c nfs: make sillyrename an async operation 2010-09-17 17:31:57 -04:00
read.c NFSv4: Ensure that we track the NFSv4 lock state in read/write requests. 2010-07-30 14:41:56 -04:00
super.c nfs: introduce mount option '-olocal_lock' to make locks local 2010-09-23 08:55:58 -04:00
symlink.c
sysctl.c
unlink.c NFS: Fix a use-after-free case in nfs_async_rename() 2010-09-21 16:52:40 -04:00
write.c Merge branch 'nfs-for-2.6.36' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2010-08-07 13:19:36 -07:00