nfsd: return CLID_INUSE for unexpected SETCLIENTID_CONFIRM case
[firefly-linux-kernel-4.4.55.git] / fs / nfsd / nfs4state.c
index 416f32e34a33cbd985ab73f9807d978544fa944b..08746ec1d44a58e43b25eebec73293aa7799d06a 100644 (file)
@@ -3111,10 +3111,11 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
        /*
         * We try hard to give out unique clientid's, so if we get an
         * attempt to confirm the same clientid with a different cred,
-        * there's a bug somewhere.  Let's charitably assume it's our
-        * bug.
+        * the client may be buggy; this should never happen.
+        *
+        * Nevertheless, RFC 7530 recommends INUSE for this case:
         */
-       status = nfserr_serverfault;
+       status = nfserr_clid_inuse;
        if (unconf && !same_creds(&unconf->cl_cred, &rqstp->rq_cred))
                goto out;
        if (conf && !same_creds(&conf->cl_cred, &rqstp->rq_cred))