memset(raw_node, 0, F2FS_BLKSIZE) sets the next_blkaddr to zero,
so that, only one reset dnode is cleaned always.
Fixes:
ad042d9194f5 "mkfs.f2fs: reset dnode with zeros",
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
#ifndef WITH_ANDROID
static int discard_obsolete_dnode(struct f2fs_node *raw_node, u_int64_t offset)
{
+ u_int64_t next_blkaddr = 0;
+
if (c.zoned_mode)
return 0;
do {
return -1;
}
+ next_blkaddr = le32_to_cpu(raw_node->footer.next_blkaddr);
memset(raw_node, 0, F2FS_BLKSIZE);
DBG(1, "\tDiscard dnode, at offset 0x%08"PRIx64"\n", offset);
MSG(1, "\tError: While discarding direct node!!!\n");
return -1;
}
- offset = le32_to_cpu(raw_node->footer.next_blkaddr);
+ offset = next_blkaddr;
} while (1);
return 0;