]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
nfsd4: be forgiving in the absence of the recovery directory
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 2 Jan 2012 22:49:12 +0000 (17:49 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 5 Jan 2012 20:23:19 +0000 (15:23 -0500)
If the recovery directory doesn't exist, then behavior after a reboot
will be suboptimal.  But it's unnecessarily harsh to then prevent the
nfsv4 server from working at all.  Instead just print a warning
(already done in nfsd4_init_recdir()) and soldier on.

Tested-by: Lior <lior@tonian.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4recover.c

index 28712e20bb1103cbe17f263c8806908ff35acdd6..eb01fffdc2f1a65c54768f47175e04566b8db3b2 100644 (file)
@@ -127,10 +127,11 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
 
        dprintk("NFSD: nfsd4_create_clid_dir for \"%s\"\n", dname);
 
-       if (!rec_file || clp->cl_firststate)
+       if (clp->cl_firststate)
                return 0;
-
        clp->cl_firststate = 1;
+       if (!rec_file)
+               return -ENOENT;
        status = nfs4_save_creds(&original_cred);
        if (status < 0)
                return status;