FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-12-2010, 08:51 AM
Steven Whitehouse
 
Default gfs2: Fix refcnt leak on gfs2_follow_link() error path

Hi,

Thanks for the patch. I've pushed it into the GFS2 -fixes tree,

Steve.

On Tue, 2010-01-12 at 03:36 +0900, OGAWA Hirofumi wrote:
> If ->follow_link handler return the error, it should decrement
> nd->path refcnt.
>
> This patch fix it.
>
> Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> ---
>
> fs/gfs2/ops_inode.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff -puN fs/gfs2/ops_inode.c~namei-gfs2-follow_link-fix fs/gfs2/ops_inode.c
> --- linux-2.6/fs/gfs2/ops_inode.c~namei-gfs2-follow_link-fix 2010-01-12 00:15:12.000000000 +0900
> +++ linux-2.6-hirofumi/fs/gfs2/ops_inode.c 2010-01-12 00:15:12.000000000 +0900
> @@ -1086,7 +1086,8 @@ static void *gfs2_follow_link(struct den
> error = vfs_follow_link(nd, buf);
> if (buf != array)
> kfree(buf);
> - }
> + } else
> + path_put(&nd->path);
>
> return ERR_PTR(error);
> }
> _
>
 
Old 02-02-2010, 08:47 AM
Steven Whitehouse
 
Default GFS2: Fix refcnt leak on gfs2_follow_link() error path

From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

If ->follow_link handler return the error, it should decrement
nd->path refcnt.

This patch fix it.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
fs/gfs2/ops_inode.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 78f73ca..84350e1 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -1088,7 +1088,8 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
error = vfs_follow_link(nd, buf);
if (buf != array)
kfree(buf);
- }
+ } else
+ path_put(&nd->path);

return ERR_PTR(error);
}
--
1.6.2.5
 

Thread Tools




All times are GMT. The time now is 02:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org