]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nfsd: Add missing gen_confirm in nfsd4_setclientid()
authorKinglong Mee <kinglongmee@gmail.com>
Mon, 13 Jul 2015 09:29:41 +0000 (17:29 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 10 Aug 2015 20:05:48 +0000 (16:05 -0400)
Commit 294ac32e99 "nfsd: protect clid and verifier generation with
client_lock" moved gen_confirm() to gen_clid().

After that commit, setclientid will return a bad reply with all-zero
verifier after copy_clid().

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index cd8c33186e26eb5fbead2ad015d7fbbd5777f624..14c49e524a5dcf5393d0de32b3fdc8600466d87a 100644 (file)
@@ -3049,10 +3049,11 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
        unconf = find_unconfirmed_client_by_name(&clname, nn);
        if (unconf)
                unhash_client_locked(unconf);
-       if (conf && same_verf(&conf->cl_verifier, &clverifier))
+       if (conf && same_verf(&conf->cl_verifier, &clverifier)) {
                /* case 1: probable callback update */
                copy_clid(new, conf);
-       else /* case 4 (new client) or cases 2, 3 (client reboot): */
+               gen_confirm(new, nn);
+       } else /* case 4 (new client) or cases 2, 3 (client reboot): */
                gen_clid(new, nn);
        new->cl_minorversion = 0;
        gen_callback(new, setclid, rqstp);