linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: "shifei10.ge" <shifei10.ge@samsung.com>
Cc: '??' <shu.tan@samsung.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: RE: [f2fs-dev] [PATCH] f2fs:fix truncate_partial_nodes bug
Date: Tue, 29 Oct 2013 16:43:17 +0900	[thread overview]
Message-ID: <1383032597.14041.12.camel@kjgkr> (raw)
In-Reply-To: <000101ced479$26555160$72fff420$%ge@samsung.com>

Hi,

2013-10-29 (화), 15:32 +0800, shifei10.ge:
> Hi,I think we don't need to put the invalid page that get_node_page returned.
> So I add " idx = i--" based on your version.Following is the patch: 
> 
> ---
>  fs/f2fs/node.c |   13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 304d5ce..fd5f721 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -631,19 +631,19 @@ static int truncate_partial_nodes(struct dnode_of_data *dn,
>  		return 0;
>  
>  	/* get indirect nodes in the path */
> -	for (i = 0; i < depth - 1; i++) {
> +	for (i = 0; i < idx + 1; i++) {
>  		/* refernece count'll be increased */
>  		pages[i] = get_node_page(sbi, nid[i]);
>  		if (IS_ERR(pages[i])) {
> -			depth = i + 1;
>  			err = PTR_ERR(pages[i]);
> +			idx = i--;

You meant (idx = i - 1)?
If so, idx = i--; is wrong.

-- 
Jaegeuk Kim
Samsung

  reply	other threads:[~2013-10-29  7:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28  8:15 [f2fs-dev] [PATCH] f2fs:fix truncate_partial_nodes bug Shifei Ge
2013-10-28 10:21 ` Jaegeuk Kim
2013-10-29  7:32   ` shifei10.ge
2013-10-29  7:43     ` Jaegeuk Kim [this message]
2013-10-29  8:07       ` shifei10.ge

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=1383032597.14041.12.camel@kjgkr \
    --to=jaegeuk.kim@samsung.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shifei10.ge@samsung.com \
    --cc=shu.tan@samsung.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).