RE: [f2fs-dev] [PATCH] f2fs:fix truncate_partial_nodes bug

From: Jaegeuk Kim
Date: Tue Oct 29 2013 - 03:44:01 EST


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

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