mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao2.yu@samsung.com>
To: "'Jaegeuk Kim'" <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: RE: [f2fs-dev] [PATCH 1/2] f2fs: check node id earily when readahead NAT page
Date: Tue, 05 Jan 2016 17:10:26 +0800	[thread overview]
Message-ID: <00a001d14799$025f1850$071d48f0$@samsung.com> (raw)
In-Reply-To: <009e01d14796$5f09a870$1d1cf950$@samsung.com>

Hi Jaegeuk,

This patch adds check for some missing cases in ("f2fs: return early
when trying to read null nid "). Merging into that patch or merging
separately is ok to me.

Thanks,

> -----Original Message-----
> From: Chao Yu [mailto:chao2.yu@samsung.com]
> Sent: Tuesday, January 05, 2016 4:52 PM
> To: Jaegeuk Kim
> Cc: linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> Subject: [f2fs-dev] [PATCH 1/2] f2fs: check node id earily when readahead NAT page
> 
> Add node id check in ra_node_page and get_node_page_ra like get_node_page.
> 
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> ---
>  fs/f2fs/node.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 6d5f548..c1ddf3d 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1041,6 +1041,10 @@ void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
>  	struct page *apage;
>  	int err;
> 
> +	if (!nid)
> +		return;
> +	f2fs_bug_on(sbi, check_nid_range(sbi, nid));
> +
>  	apage = find_get_page(NODE_MAPPING(sbi), nid);
>  	if (apage && PageUptodate(apage)) {
>  		f2fs_put_page(apage, 0);
> @@ -1108,6 +1112,7 @@ struct page *get_node_page_ra(struct page *parent, int start)
>  	nid = get_nid(parent, start, false);
>  	if (!nid)
>  		return ERR_PTR(-ENOENT);
> +	f2fs_bug_on(sbi, check_nid_range(sbi, nid));
>  repeat:
>  	page = grab_cache_page(NODE_MAPPING(sbi), nid);
>  	if (!page)
> @@ -1127,9 +1132,9 @@ repeat:
>  	end = start + MAX_RA_NODE;
>  	end = min(end, NIDS_PER_BLOCK);
>  	for (i = start + 1; i < end; i++) {
> -		nid_t tnid = get_nid(parent, i, false);
> -		if (!tnid)
> -			continue;
> +		nid_t tnid;
> +
> +		tnid = get_nid(parent, i, false);
>  		ra_node_page(sbi, tnid);
>  	}
> 
> --
> 2.6.3
> 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


      reply	other threads:[~2016-01-05  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05  8:51 Chao Yu
2016-01-05  9:10 ` Chao Yu [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='00a001d14799$025f1850$071d48f0$@samsung.com' \
    --to=chao2.yu@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome