linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yunlei He <heyunlei@huawei.com>
Cc: Shuoran Liu <liushuoran@huawei.com>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-linux 3.10][PATCH] f2fs: Fix a system panic caused by f2fs_follow_link
Date: Mon, 30 Nov 2015 15:14:37 -0800	[thread overview]
Message-ID: <20151130231437.GA49656@jaegeuk.local> (raw)
In-Reply-To: <1448692720-16658-1-git-send-email-heyunlei@huawei.com>

Hi Yunlei,

Merged into the new 3.10 repo:

http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-stable.git/log/?h=linux-3.10.y

Thanks,

On Sat, Nov 28, 2015 at 02:38:40PM +0800, Yunlei He wrote:
> In linux 3.10, we can not make sure the return value of nd_get_link function
> is valid. So this patch add a check before use it.
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> Signed-off-by: Shuoran Liu <liushuoran@huawei.com>
> 
> ---
>  fs/f2fs/namei.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
> index 336d43d..bfaec10 100644
> --- a/fs/f2fs/namei.c
> +++ b/fs/f2fs/namei.c
> @@ -319,13 +319,18 @@ fail:
>  static void *f2fs_follow_link(struct dentry *dentry, struct nameidata *nd)
>  {
>  	struct page *page;
> +	char *link;
>  
>  	page = page_follow_link_light(dentry, nd);
>  	if (IS_ERR(page))
>  		return page;
>  
> +	link = nd_get_link(nd);
> +	if (IS_ERR(link))
> +		return link;
> +
>  	/* this is broken symlink case */
> -	if (*nd_get_link(nd) == 0) {
> +	if (*link == 0) {
>  		kunmap(page);
>  		page_cache_release(page);
>  		return ERR_PTR(-ENOENT);
> -- 
> 1.9.1

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140

      reply	other threads:[~2015-11-30 23:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-28  6:38 [f2fs-linux 3.10][PATCH] f2fs: Fix a system panic caused by f2fs_follow_link Yunlei He
2015-11-30 23:14 ` Jaegeuk Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151130231437.GA49656@jaegeuk.local \
    --to=jaegeuk@kernel.org \
    --cc=heyunlei@huawei.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=liushuoran@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).