diff options
author | Mi Jinlong <mijinlong@cn.fujitsu.com> | 2011-04-26 21:14:30 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-04-29 20:47:56 -0400 |
commit | bcecf1ccc336200ee488e8eb68acdafc4b0dbd1a (patch) | |
tree | b3376aa05de0925490c04a19edfdabf87c4507d6 /fs | |
parent | 868b89c3dc25eec03985b31ff070e8f73c818980 (diff) |
nfsd41: error out on repeated RECLAIM_COMPLETE
Servers are supposed to return nfserr_complete_already to clients that
attempt to send multiple RECLAIM_COMPLETEs.
Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4state.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 3196dc388578..2bb03f86a037 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1818,6 +1818,8 @@ out: | |||
1818 | __be32 | 1818 | __be32 |
1819 | nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc) | 1819 | nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc) |
1820 | { | 1820 | { |
1821 | int status = 0; | ||
1822 | |||
1821 | if (rc->rca_one_fs) { | 1823 | if (rc->rca_one_fs) { |
1822 | if (!cstate->current_fh.fh_dentry) | 1824 | if (!cstate->current_fh.fh_dentry) |
1823 | return nfserr_nofilehandle; | 1825 | return nfserr_nofilehandle; |
@@ -1827,9 +1829,14 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta | |||
1827 | */ | 1829 | */ |
1828 | return nfs_ok; | 1830 | return nfs_ok; |
1829 | } | 1831 | } |
1832 | |||
1830 | nfs4_lock_state(); | 1833 | nfs4_lock_state(); |
1831 | if (is_client_expired(cstate->session->se_client)) { | 1834 | status = nfserr_complete_already; |
1832 | nfs4_unlock_state(); | 1835 | if (cstate->session->se_client->cl_firststate) |
1836 | goto out; | ||
1837 | |||
1838 | status = nfserr_stale_clientid; | ||
1839 | if (is_client_expired(cstate->session->se_client)) | ||
1833 | /* | 1840 | /* |
1834 | * The following error isn't really legal. | 1841 | * The following error isn't really legal. |
1835 | * But we only get here if the client just explicitly | 1842 | * But we only get here if the client just explicitly |
@@ -1837,11 +1844,13 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta | |||
1837 | * error it gets back on an operation for the dead | 1844 | * error it gets back on an operation for the dead |
1838 | * client. | 1845 | * client. |
1839 | */ | 1846 | */ |
1840 | return nfserr_stale_clientid; | 1847 | goto out; |
1841 | } | 1848 | |
1849 | status = nfs_ok; | ||
1842 | nfsd4_create_clid_dir(cstate->session->se_client); | 1850 | nfsd4_create_clid_dir(cstate->session->se_client); |
1851 | out: | ||
1843 | nfs4_unlock_state(); | 1852 | nfs4_unlock_state(); |
1844 | return nfs_ok; | 1853 | return status; |
1845 | } | 1854 | } |
1846 | 1855 | ||
1847 | __be32 | 1856 | __be32 |