From: J. Bruce Fields Date: Mon, 2 Jan 2012 22:49:12 +0000 (-0500) Subject: nfsd4: be forgiving in the absence of the recovery directory X-Git-Tag: firefly_0821_release~3680^2~3719^2~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b8548894bde94ccee836e210274ff401225e9733;p=firefly-linux-kernel-4.4.55.git nfsd4: be forgiving in the absence of the recovery directory 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 Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 28712e20bb11..eb01fffdc2f1 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -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;