Commit ba3fd7aa authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: provide no_cb_path error on renew

If the client was given a delegation, but our callback path to the client has
since failed for some reason, then our only chance to inform the client of this
is to return the cb_path_down error next time the client attempts to renew its
state.
Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 92c8e22c
...@@ -1809,19 +1809,19 @@ nfsd4_renew(clientid_t *clid) ...@@ -1809,19 +1809,19 @@ nfsd4_renew(clientid_t *clid)
status = nfserr_stale_clientid; status = nfserr_stale_clientid;
if (STALE_CLIENTID(clid)) if (STALE_CLIENTID(clid))
goto out; goto out;
status = nfs_ok;
clp = find_confirmed_client(clid); clp = find_confirmed_client(clid);
if (clp) { status = nfserr_expired;
renew_client(clp); if (clp == NULL) {
/* We assume the client took too long to RENEW. */
dprintk("nfsd4_renew: clientid not found!\n");
goto out; goto out;
} }
/* renew_client(clp);
* Couldn't find an nfs4_client for this clientid. status = nfserr_cb_path_down;
* Presumably this is because the client took too long to if (!list_empty(&clp->cl_del_perclnt)
* RENEW, so return NFS4ERR_EXPIRED. && !atomic_read(&clp->cl_callback.cb_set))
*/ goto out;
dprintk("nfsd4_renew: clientid not found!\n"); status = nfs_ok;
status = nfserr_expired;
out: out:
nfs4_unlock_state(); nfs4_unlock_state();
return status; return status;
......
...@@ -209,6 +209,7 @@ void nfsd_lockd_shutdown(void); ...@@ -209,6 +209,7 @@ void nfsd_lockd_shutdown(void);
#define nfserr_no_grace __constant_htonl(NFSERR_NO_GRACE) #define nfserr_no_grace __constant_htonl(NFSERR_NO_GRACE)
#define nfserr_reclaim_bad __constant_htonl(NFSERR_RECLAIM_BAD) #define nfserr_reclaim_bad __constant_htonl(NFSERR_RECLAIM_BAD)
#define nfserr_badname __constant_htonl(NFSERR_BADNAME) #define nfserr_badname __constant_htonl(NFSERR_BADNAME)
#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
/* error codes for internal use */ /* error codes for internal use */
/* if a request fails due to kmalloc failure, it gets dropped. /* if a request fails due to kmalloc failure, it gets dropped.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment