Skip to content

Commit

Permalink
nfsd: fix error handling in nfsd4_remove_clid_dir
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Nov 10, 2012
1 parent 292a417 commit 698d8d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfsd/nfs4recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 698d8d8

Please sign in to comment.