From: Robin Dong <sanbai at taobao.com> To write 'btree_counter' back, we should give memory of 'inode->btree_counter' to writer instead of 'inode'. Signed-off-by: Robin Dong <sanbai at taobao.com> --- lib/sd_inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sd_inode.c b/lib/sd_inode.c index 4f5e8cf..4c32009 100644 --- a/lib/sd_inode.c +++ b/lib/sd_inode.c @@ -677,7 +677,8 @@ int sd_inode_write(write_node_fn writer, struct sd_inode *inode, int flags, create, false); if (ret != SD_RES_SUCCESS) goto out; - ret = writer(vid_to_vdi_oid(inode->vdi_id), inode, + ret = writer(vid_to_vdi_oid(inode->vdi_id), + &(inode->btree_counter), sizeof(uint32_t), offsetof(struct sd_inode, btree_counter), flags, inode->nr_copies, inode->copy_policy, -- 1.7.12.4 |