CEPH filesystem development
 help / color / mirror / Atom feed
* [PATCH 3/3] ceph: fix dentry reference leak in ceph_encode_fh().
       [not found] <1352666971-13551-1-git-send-email-tipecaml@gmail.com>
@ 2012-11-11 20:49 ` Cyril Roelandt
  2012-11-20 16:21   ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Cyril Roelandt @ 2012-11-11 20:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors, Cyril Roelandt, sage, ceph-devel

dput() was not called in the error path.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 fs/ceph/export.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 9349bb3..ca3ab3f 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -56,13 +56,15 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
 	struct ceph_nfs_confh *cfh = (void *)rawfh;
 	int connected_handle_length = sizeof(*cfh)/4;
 	int handle_length = sizeof(*fh)/4;
-	struct dentry *dentry = d_find_alias(inode);
+	struct dentry *dentry;
 	struct dentry *parent;
 
 	/* don't re-export snaps */
 	if (ceph_snap(inode) != CEPH_NOSNAP)
 		return -EINVAL;
 
+	dentry = d_find_alias(inode);
+
 	/* if we found an alias, generate a connectable fh */
 	if (*max_len >= connected_handle_length && dentry) {
 		dout("encode_fh %p connectable\n", dentry);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] ceph: fix dentry reference leak in ceph_encode_fh().
  2012-11-11 20:49 ` [PATCH 3/3] ceph: fix dentry reference leak in ceph_encode_fh() Cyril Roelandt
@ 2012-11-20 16:21   ` Alex Elder
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Elder @ 2012-11-20 16:21 UTC (permalink / raw)
  To: Cyril Roelandt; +Cc: linux-kernel, kernel-janitors, sage, ceph-devel

On 11/11/2012 02:49 PM, Cyril Roelandt wrote:
> dput() was not called in the error path.
> 
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>

This looks good, thanks a lot.  I'll apply it.

Reviewed-by: Alex Elder <elder@inktank.com>

> ---
>  fs/ceph/export.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/export.c b/fs/ceph/export.c
> index 9349bb3..ca3ab3f 100644
> --- a/fs/ceph/export.c
> +++ b/fs/ceph/export.c
> @@ -56,13 +56,15 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
>  	struct ceph_nfs_confh *cfh = (void *)rawfh;
>  	int connected_handle_length = sizeof(*cfh)/4;
>  	int handle_length = sizeof(*fh)/4;
> -	struct dentry *dentry = d_find_alias(inode);
> +	struct dentry *dentry;
>  	struct dentry *parent;
>  
>  	/* don't re-export snaps */
>  	if (ceph_snap(inode) != CEPH_NOSNAP)
>  		return -EINVAL;
>  
> +	dentry = d_find_alias(inode);
> +
>  	/* if we found an alias, generate a connectable fh */
>  	if (*max_len >= connected_handle_length && dentry) {
>  		dout("encode_fh %p connectable\n", dentry);
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-20 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1352666971-13551-1-git-send-email-tipecaml@gmail.com>
2012-11-11 20:49 ` [PATCH 3/3] ceph: fix dentry reference leak in ceph_encode_fh() Cyril Roelandt
2012-11-20 16:21   ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox