summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4recover.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-01-02 23:30:05 +0100
committerJ. Bruce Fields <bfields@redhat.com>2012-01-02 23:32:59 +0100
commitaec39680b02ed55fcbb2bc87ad96eba16a651546 (patch)
tree82a98b007a9bce8fbd290584da812c446c74ae59 /fs/nfsd/nfs4recover.c
parentNFSD: forget_delegations should use list_for_each_entry_safe (diff)
downloadlinux-aec39680b02ed55fcbb2bc87ad96eba16a651546.tar.xz
linux-aec39680b02ed55fcbb2bc87ad96eba16a651546.zip
nfsd4: fix spurious 4.1 post-reboot failures
In the NFSv4.1 case, this could cause a spurious "NFSD: failed to write recovery record (err -17); please check that /var/lib/nfs/v4recovery exists and is writable. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Reported-by: Steve Dickson <SteveD@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4recover.c')
-rw-r--r--fs/nfsd/nfs4recover.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index ed083b9a731b..28712e20bb11 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -144,8 +144,15 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
status = PTR_ERR(dentry);
goto out_unlock;
}
- status = -EEXIST;
if (dentry->d_inode)
+ /*
+ * In the 4.1 case, where we're called from
+ * reclaim_complete(), records from the previous reboot
+ * may still be left, so this is OK.
+ *
+ * In the 4.0 case, we should never get here; but we may
+ * as well be forgiving and just succeed silently.
+ */
goto out_put;
status = mnt_want_write(rec_file->f_path.mnt);
if (status)