> -----Original Message-----
> From: Jaegeuk Kim [mailto:[email protected]]
> Sent: Tuesday, October 29, 2013 3:43 PM
> To: shifei10.ge
> Cc: '??'; [email protected]; [email protected]; linux-
> [email protected]
> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to