Commit 22de4d83 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] knfsd: nfsd4: fix setclientid_confirm error return

NFS4_INVAL is not a valid error for setclientid_confirm, and INUSE is the more
logical error here anyway.

From: Fred Isaman
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 1a69c179
...@@ -849,12 +849,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -849,12 +849,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
nfs4_lock_state(); nfs4_lock_state();
clp = find_confirmed_client(clid); clp = find_confirmed_client(clid);
if (clp) { if (clp) {
status = nfserr_inval; status = nfserr_clid_inuse;
/*
* Found a record for this clientid. If the IP addresses
* don't match, return ERR_INVAL just as if the record had
* not been found.
*/
if (clp->cl_addr != ip_addr) { if (clp->cl_addr != ip_addr) {
printk("NFSD: setclientid: string in use by client" printk("NFSD: setclientid: string in use by client"
"(clientid %08x/%08x)\n", "(clientid %08x/%08x)\n",
...@@ -865,7 +860,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -865,7 +860,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
} }
clp = find_unconfirmed_client(clid); clp = find_unconfirmed_client(clid);
if (clp) { if (clp) {
status = nfserr_inval; status = nfserr_clid_inuse;
if (clp->cl_addr != ip_addr) { if (clp->cl_addr != ip_addr) {
printk("NFSD: setclientid: string in use by client" printk("NFSD: setclientid: string in use by client"
"(clientid %08x/%08x)\n", "(clientid %08x/%08x)\n",
...@@ -949,7 +944,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -949,7 +944,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
goto out; goto out;
} }
/* check that we have hit one of the cases...*/ /* check that we have hit one of the cases...*/
status = nfserr_inval; status = nfserr_clid_inuse;
goto out; goto out;
out: out:
if (!status) if (!status)
......
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