* [PATCH] gfs2: Fix refcnt leak on gfs2_follow_link() error path
@ 2010-01-11 18:36 OGAWA Hirofumi
2010-01-12 9:51 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: OGAWA Hirofumi @ 2010-01-11 18:36 UTC (permalink / raw)
To: Steven Whitehouse; +Cc: cluster-devel, linux-kernel, linux-fsdevel
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);
}
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gfs2: Fix refcnt leak on gfs2_follow_link() error path
2010-01-11 18:36 [PATCH] gfs2: Fix refcnt leak on gfs2_follow_link() error path OGAWA Hirofumi
@ 2010-01-12 9:51 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2010-01-12 9:51 UTC (permalink / raw)
To: OGAWA Hirofumi; +Cc: cluster-devel, linux-kernel, linux-fsdevel
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);
> }
> _
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-12 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 18:36 [PATCH] gfs2: Fix refcnt leak on gfs2_follow_link() error path OGAWA Hirofumi
2010-01-12 9:51 ` Steven Whitehouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).