1
0
Fork 0
alistair23-linux/fs/nfsd
Jeff Layton 91885258e8 nfsd: don't break lease while servicing a COMMIT
This is the second attempt to fix the problem whereby a COMMIT call
causes a lease break and triggers a possible deadlock.

The problem is that nfsd attempts to break a lease on a COMMIT call.
This triggers a delegation recall if the lease is held for a delegation.
If the client is the one holding the delegation and it's the same one on
which it's issuing the COMMIT, then it can't return that delegation
until the COMMIT is complete. But, nfsd won't complete the COMMIT until
the delegation is returned. The client and server are essentially
deadlocked until the state is marked bad (due to the client not
responding on the callback channel).

The first patch attempted to deal with this by eliminating the open of
the file altogether and simply had nfsd_commit pass a NULL file pointer
to the vfs_fsync_range. That would conflict with some work in progress
by Christoph Hellwig to clean up the fsync interface, so this patch
takes a different approach.

This declares a new NFSD_MAY_NOT_BREAK_LEASE access flag that indicates
to nfsd_open that it should not break any leases when opening the file,
and has nfsd_commit set that flag on the nfsd_open call.

For now, this patch leaves nfsd_commit opening the file with write
access since I'm not clear on what sort of access would be more
appropriate.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2010-03-22 15:37:53 -04:00
..
Kconfig nfsd : Define NFSD only when FILE_LOCKING is enabled 2009-03-18 17:30:48 -04:00
Makefile knfsd: trivial makefile cleanup 2007-05-09 12:30:54 -07:00
auth.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
auth.h nfsd: minor fs/nfsd/auth.h cleanup 2008-02-01 16:42:05 -05:00
cache.h nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
export.c nfsd: factor out hash functions for export caches. 2010-03-16 18:05:11 -04:00
lockd.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs2acl.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs3acl.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs3proc.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs3xdr.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs4acl.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs4callback.c nfsd4: simplify references to nfsd4 lease time 2010-03-06 15:02:01 -05:00
nfs4idmap.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs4proc.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfs4recover.c commit_metadata export operation replacing nfsd_sync_dir 2010-02-20 13:13:44 -08:00
nfs4state.c Merge commit 'v2.6.34-rc1' into for-2.6.35-incoming 2010-03-09 17:22:08 -05:00
nfs4xdr.c Merge commit 'v2.6.34-rc1' into for-2.6.35-incoming 2010-03-09 17:22:08 -05:00
nfscache.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfsctl.c nfsd4: document lease/grace-period limits 2010-03-06 15:02:10 -05:00
nfsd.h nfsd4: allow setting grace period time 2010-03-06 15:02:08 -05:00
nfsfh.c nfsd: fix "insecure" export option 2009-12-20 20:19:51 -08:00
nfsfh.h nfsd: move most of nfsfh.h to fs/nfsd 2009-12-15 15:01:46 -05:00
nfsproc.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfssvc.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
nfsxdr.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
state.h nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
stats.c nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
vfs.c nfsd: don't break lease while servicing a COMMIT 2010-03-22 15:37:53 -04:00
vfs.h nfsd: don't break lease while servicing a COMMIT 2010-03-22 15:37:53 -04:00
xdr.h nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
xdr3.h nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00
xdr4.h nfsd: remove pointless paths in file headers 2009-12-15 15:01:47 -05:00