* [PATCH] nfsd: fix error handling in nfsd4_remove_clid_dir
@ 2012-11-09 20:31 Jeff Layton
2012-11-10 19:52 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2012-11-09 20:31 UTC (permalink / raw)
To: bfields; +Cc: linux-nfs
If the credential save fails, then we'll leak our mnt_want_write_file
reference.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/nfsd/nfs4recover.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 43295d4..0f1e2e2 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)
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nfsd: fix error handling in nfsd4_remove_clid_dir
2012-11-09 20:31 [PATCH] nfsd: fix error handling in nfsd4_remove_clid_dir Jeff Layton
@ 2012-11-10 19:52 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2012-11-10 19:52 UTC (permalink / raw)
To: Jeff Layton; +Cc: linux-nfs
On Fri, Nov 09, 2012 at 03:31:53PM -0500, Jeff Layton wrote:
> If the credential save fails, then we'll leak our mnt_want_write_file
> reference.
Thanks, applying.--b.
>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
> fs/nfsd/nfs4recover.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
> index 43295d4..0f1e2e2 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)
> --
> 1.7.11.7
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-10 19:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 20:31 [PATCH] nfsd: fix error handling in nfsd4_remove_clid_dir Jeff Layton
2012-11-10 19:52 ` J. Bruce Fields
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.