]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
nfsd: fix error handling in nfsd4_remove_clid_dir
authorJeff Layton <jlayton@redhat.com>
Fri, 9 Nov 2012 20:31:53 +0000 (15:31 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Sat, 10 Nov 2012 19:52:03 +0000 (14:52 -0500)
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>
fs/nfsd/nfs4recover.c

index 43295d45cc2b553e2afda4d11d7b2d429b8676ef..0f1e2e21f7d9789789b3c185dc4879039cfef29e 100644 (file)
@@ -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)