Commit 3e772463 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd4: stop using nfserr_resource for transitory errors

The server is returning nfserr_resource for both permanent errors and
for errors (like allocation failures) that might be resolved by retrying
later.  Save nfserr_resource for the former and use delay/jukebox for
the latter.

Cc: stable@kernel.org
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 6577aac0
...@@ -940,7 +940,7 @@ _nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -940,7 +940,7 @@ _nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
count = 4 + (verify->ve_attrlen >> 2); count = 4 + (verify->ve_attrlen >> 2);
buf = kmalloc(count << 2, GFP_KERNEL); buf = kmalloc(count << 2, GFP_KERNEL);
if (!buf) if (!buf)
return nfserr_resource; return nfserr_jukebox;
status = nfsd4_encode_fattr(&cstate->current_fh, status = nfsd4_encode_fattr(&cstate->current_fh,
cstate->current_fh.fh_export, cstate->current_fh.fh_export,
......
...@@ -89,7 +89,7 @@ nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname) ...@@ -89,7 +89,7 @@ nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname)
struct xdr_netobj cksum; struct xdr_netobj cksum;
struct hash_desc desc; struct hash_desc desc;
struct scatterlist sg; struct scatterlist sg;
__be32 status = nfserr_resource; __be32 status = nfserr_jukebox;
dprintk("NFSD: nfs4_make_rec_clidname for %.*s\n", dprintk("NFSD: nfs4_make_rec_clidname for %.*s\n",
clname->len, clname->data); clname->len, clname->data);
......
...@@ -1944,7 +1944,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -1944,7 +1944,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
* of 5 bullet points, labeled as CASE0 - CASE4 below. * of 5 bullet points, labeled as CASE0 - CASE4 below.
*/ */
unconf = find_unconfirmed_client_by_str(dname, strhashval); unconf = find_unconfirmed_client_by_str(dname, strhashval);
status = nfserr_resource; status = nfserr_jukebox;
if (!conf) { if (!conf) {
/* /*
* RFC 3530 14.2.33 CASE 4: * RFC 3530 14.2.33 CASE 4:
...@@ -2481,7 +2481,7 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate, ...@@ -2481,7 +2481,7 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
if (open->op_stateowner == NULL) { if (open->op_stateowner == NULL) {
sop = alloc_init_open_stateowner(strhashval, clp, open); sop = alloc_init_open_stateowner(strhashval, clp, open);
if (sop == NULL) if (sop == NULL)
return nfserr_resource; return nfserr_jukebox;
open->op_stateowner = sop; open->op_stateowner = sop;
} }
list_del_init(&sop->so_close_lru); list_del_init(&sop->so_close_lru);
...@@ -2617,7 +2617,7 @@ nfs4_new_open(struct svc_rqst *rqstp, struct nfs4_stateid **stpp, ...@@ -2617,7 +2617,7 @@ nfs4_new_open(struct svc_rqst *rqstp, struct nfs4_stateid **stpp,
stp = nfs4_alloc_stateid(); stp = nfs4_alloc_stateid();
if (stp == NULL) if (stp == NULL)
return nfserr_resource; return nfserr_jukebox;
status = nfs4_get_vfs_file(rqstp, fp, cur_fh, open); status = nfs4_get_vfs_file(rqstp, fp, cur_fh, open);
if (status) { if (status) {
...@@ -2848,7 +2848,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf ...@@ -2848,7 +2848,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
status = nfserr_bad_stateid; status = nfserr_bad_stateid;
if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR) if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR)
goto out; goto out;
status = nfserr_resource; status = nfserr_jukebox;
fp = alloc_init_file(ino); fp = alloc_init_file(ino);
if (fp == NULL) if (fp == NULL)
goto out; goto out;
...@@ -4033,7 +4033,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -4033,7 +4033,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
/* XXX: Do we need to check for duplicate stateowners on /* XXX: Do we need to check for duplicate stateowners on
* the same file, or should they just be allowed (and * the same file, or should they just be allowed (and
* create new stateids)? */ * create new stateids)? */
status = nfserr_resource; status = nfserr_jukebox;
lock_sop = alloc_init_lock_stateowner(strhashval, lock_sop = alloc_init_lock_stateowner(strhashval,
open_sop->so_client, open_stp, lock); open_sop->so_client, open_stp, lock);
if (lock_sop == NULL) if (lock_sop == NULL)
...@@ -4119,7 +4119,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -4119,7 +4119,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
break; break;
default: default:
dprintk("NFSD: nfsd4_lock: vfs_lock_file() failed! status %d\n",err); dprintk("NFSD: nfsd4_lock: vfs_lock_file() failed! status %d\n",err);
status = nfserr_resource; status = nfserrno(err);
break; break;
} }
out: out:
......
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