alistair23-linux/fs/nfs
Chuck Lever 377e507d15 NFS: Fix up TEST_STATEID and FREE_STATEID return code handling
The TEST_STATEID and FREE_STATEID operations can return
-NFS4ERR_BAD_STATEID, -NFS4ERR_OLD_STATEID, or -NFS4ERR_DEADSESSION.

nfs41_{test,free}_stateid() should not pass these errors to
nfs4_handle_exception() during state recovery, since that will
recursively kick off state recovery again, resulting in a deadlock.

In particular, when the TEST_STATEID operation returns NFS4_OK,
res.status can contain one of these errors.  _nfs41_test_stateid()
replaces NFS4_OK with the value in res.status, which is then returned
to callers.

But res.status is not passed through nfs4_stat_to_errno(), and thus is
a positive NFS4ERR value.  Currently callers are only interested in
!NFS4_OK, and nfs4_handle_exception() ignores positive values.

Thus the res.status values are currently ignored by
nfs4_handle_exception() and won't cause the deadlock above.  Thanks to
this missing negative, it is only when these operations fail (which
is very rare) that a deadlock can occur.

Bryan agrees the original intent was to return res.status as a
negative NFS4ERR value to callers of nfs41_test_stateid().

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-07-16 14:47:52 -04:00
..
blocklayout NFS: Use proper naming conventions for the nfs_client.net field 2012-05-22 16:45:44 -04:00
objlayout NFS: Fix sparse warnings 2012-05-04 14:59:51 -04:00
cache_lib.c
cache_lib.h
callback.c NFS: hard-code init_net for NFS callback transports 2012-06-14 13:53:43 -04:00
callback.h
callback_proc.c
callback_xdr.c NFS: add an endian notation for sparse 2012-06-12 09:54:40 -04:00
client.c NFS: Create an alloc_client rpc_op 2012-06-29 11:46:46 -04:00
delegation.c NFS: Create a return_delegation rpc op 2012-06-29 11:46:45 -04:00
delegation.h NFS: Create a return_delegation rpc op 2012-06-29 11:46:45 -04:00
dir.c Merge commit '9249e17fe094d853d1ef7475dd559a2cc7e23d42' into nfs-for-3.6 2012-07-16 12:01:42 -04:00
direct.c NFS: Fix list manipulation snafus in fs/nfs/direct.c 2012-07-08 10:32:08 -04:00
dns_resolve.c
dns_resolve.h
file.c NFS: Create a have_delegation rpc_op 2012-06-29 11:46:44 -04:00
fscache-index.c
fscache.c NFS: Don't pass mount data to nfs_fscache_get_super_cookie() 2012-05-14 17:30:26 -07:00
fscache.h NFS: Fix a compile issue when CONFIG_NFS_FSCACHE was undefined 2012-05-16 10:24:20 -07:00
getroot.c vfs: switch i_dentry/d_alias to hlist 2012-07-14 16:32:55 +04:00
idmap.c NFS: Force the legacy idmapper to be single threaded 2012-06-20 14:38:11 -04:00
inode.c NFS: Create a return_delegation rpc op 2012-06-29 11:46:45 -04:00
internal.h NFS: Create an write_pageio_init() function 2012-06-29 11:46:46 -04:00
iostat.h
Kconfig NFS: Simplify NFSv4.1 Kconfig 2012-06-28 17:20:51 -04:00
Makefile NFS: Make v2 configurable 2012-05-14 17:42:22 -07:00
mount_clnt.c
namespace.c NFS: Remove extra rpc_clnt argument to proc_lookup 2012-04-27 14:10:39 -04:00
netns.h NFS: Always use the same SETCLIENTID boot verifier 2012-05-22 16:45:46 -04:00
nfs2xdr.c NFS: Let xdr_read_pages() check for buffer overflows 2012-06-28 17:20:43 -04:00
nfs3acl.c
nfs3proc.c Merge commit '9249e17fe094d853d1ef7475dd559a2cc7e23d42' into nfs-for-3.6 2012-07-16 12:01:42 -04:00
nfs3xdr.c NFS: Cleanup - only store the write verifier in struct nfs_page 2012-06-28 17:20:50 -04:00
nfs4_fs.h NFS: Create custom NFS v4 write_inode() function 2012-06-29 11:46:47 -04:00
nfs4filelayout.c NFSv4.1 don't send LAYOUTCOMMIT if data resent through MDS 2012-07-16 14:37:00 -04:00
nfs4filelayout.h NFSv4.1 resend LAYOUTGET on data server invalid layout errors 2012-05-19 17:55:33 -04:00
nfs4filelayoutdev.c NFSv4.1: Use session max response size for GETDEVICEINFO gdia_maxcount 2012-06-28 17:20:50 -04:00
nfs4namespace.c Merge branch 'bugfixes' into nfs-for-next 2012-05-21 10:12:39 -04:00
nfs4proc.c NFS: Fix up TEST_STATEID and FREE_STATEID return code handling 2012-07-16 14:47:52 -04:00
nfs4renewd.c NFS: Add NFSDBG_STATE 2012-05-22 16:45:42 -04:00
nfs4state.c NFSv4.1: Clean up nfs4_reclaim_lease 2012-06-28 17:20:49 -04:00
nfs4xdr.c NFS: Cleanup - only store the write verifier in struct nfs_page 2012-06-28 17:20:50 -04:00
nfsroot.c
pagelist.c NFS: Clean up - Rename nfs_unlock_request and nfs_unlock_request_dont_release 2012-05-09 15:17:43 -04:00
pnfs.c NFSv4.1 do not send LAYOUTRETURN on emtpy plh_segs list 2012-07-16 14:39:00 -04:00
pnfs.h NFSv4.1 mark layout when already returned 2012-07-16 14:37:25 -04:00
pnfs_dev.c
proc.c Merge commit '9249e17fe094d853d1ef7475dd559a2cc7e23d42' into nfs-for-3.6 2012-07-16 12:01:42 -04:00
read.c NFS: Create an read_pageio_init() function 2012-06-29 11:46:46 -04:00
super.c Merge commit '9249e17fe094d853d1ef7475dd559a2cc7e23d42' into nfs-for-3.6 2012-07-16 12:01:42 -04:00
symlink.c
sysctl.c
unlink.c NFS: Create a return_delegation rpc op 2012-06-29 11:46:45 -04:00
write.c NFS: Create custom NFS v4 write_inode() function 2012-06-29 11:46:47 -04:00