From 184aa224be091e65939c4afab03edc9ba127bd9b Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Thu, 8 Dec 2016 03:27:39 +0900 Subject: [PATCH] sbin/hammer: Use HAMMER_OBJID_ROOT --- sbin/hammer/cmd_recover.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sbin/hammer/cmd_recover.c b/sbin/hammer/cmd_recover.c index 828ec1fcd9..7cbca16f28 100644 --- a/sbin/hammer/cmd_recover.c +++ b/sbin/hammer/cmd_recover.c @@ -219,6 +219,12 @@ recover_elm(hammer_btree_leaf_elm_t leaf) pfs_id = lo_to_pfs(leaf->base.localization); + /* + * Note that meaning of leaf->base.obj_id differs depending + * on record type. For a direntry, leaf->base.obj_id points + * to its parent inode that this entry is a part of, but not + * its corresponding inode. + */ dict = get_dict(leaf->base.obj_id, pfs_id); switch(leaf->base.rec_type) { @@ -501,7 +507,7 @@ get_dict(int64_t obj_id, uint16_t pfs_id) * real parent directory object is. */ if (dict->obj_id != HAMMER_OBJID_ROOT) - dict->parent = get_dict(1, pfs_id); + dict->parent = get_dict(HAMMER_OBJID_ROOT, pfs_id); } return(dict); } -- 2.11.4.GIT