lkml.org 
[lkml]   [2013]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [f2fs-dev] [PATCH] f2fs:fix truncate_partial_nodes bug
Date


> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk.kim@samsung.com]
> Sent: Tuesday, October 29, 2013 3:43 PM
> To: shifei10.ge
> Cc: '??'; 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
>
> 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.

Yes,here should be : idx = --i;

>
> --
> Jaegeuk Kim
> Samsung

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-10-29 09:21    [W:0.043 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site