summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4recover.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-11-09 21:31:53 +0100
committerJ. Bruce Fields <bfields@redhat.com>2012-11-10 20:52:03 +0100
commit698d8d875a0593f65092f6619d97de49bc5caa45 (patch)
tree16bf075704d07d401c0f4db9276b9f975864f3ef /fs/nfsd/nfs4recover.c
parentnfsd4: update documentation on 4.1 progress (diff)
downloadlinux-698d8d875a0593f65092f6619d97de49bc5caa45.tar.xz
linux-698d8d875a0593f65092f6619d97de49bc5caa45.zip
nfsd: fix error handling in nfsd4_remove_clid_dir
If the credential save fails, then we'll leak our mnt_want_write_file reference. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4recover.c')
-rw-r--r--fs/nfsd/nfs4recover.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 43295d45cc2b..0f1e2e21f7d9 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -301,12 +301,13 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp)
status = nfs4_save_creds(&original_cred);
if (status < 0)
- goto out;
+ goto out_drop_write;
status = nfsd4_unlink_clid_dir(clp->cl_recdir, HEXDIR_LEN-1);
nfs4_reset_creds(original_cred);
if (status == 0)
vfs_fsync(rec_file, 0);
+out_drop_write:
mnt_drop_write_file(rec_file);
out:
if (status)