We need to mask VDI_BIT to calculate data object id. Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp> --- include/meta.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/meta.h b/include/meta.h index 338f660..208b2e1 100644 --- a/include/meta.h +++ b/include/meta.h @@ -54,7 +54,7 @@ struct sheepdog_inode { static inline int is_data_obj_writeable(struct sheepdog_inode *inode, int idx) { - return (inode->oid >> VDI_SPACE_SHIFT) == + return ((inode->oid & ~VDI_BIT) >> VDI_SPACE_SHIFT) == (inode->data_oid[idx] >> VDI_SPACE_SHIFT); } -- 1.5.6.5 |