Skip to content

Commit

Permalink
DAOS-7170 obj: fix bug in obj_list_get_shard (#5334)
Browse files Browse the repository at this point in the history
Fix a bug of obj_list_get_shard()'s grp_idx calculation.

Signed-off-by: Xuezhao Liu <xuezhao.liu@intel.com>
  • Loading branch information
liuxuezhao authored and Di Wang committed Apr 24, 2021
1 parent d701384 commit 234cb1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/object/cli_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -4558,7 +4558,7 @@ obj_ec_list_get_shard(struct obj_auxi_args *obj_auxi, unsigned int map_ver,
shard = first;
}
out:
D_DEBUG(DB_IO, "get shard %d on "DF_OID"\n", shard,
D_DEBUG(DB_IO, "grp_idx %d, get shard %d on "DF_OID"\n", grp_idx, shard,
DP_OID(obj->cob_md.omd_id));
return shard;
}
Expand Down Expand Up @@ -4621,7 +4621,8 @@ obj_list_get_shard(struct obj_auxi_args *obj_auxi, unsigned int map_ver,
grp_idx = obj_dkey2grpidx(obj, dkey_hash, map_ver);
} else {
D_ASSERT(args->dkey_anchor != NULL);
grp_idx = dc_obj_anchor2shard(args->dkey_anchor);
grp_idx = dc_obj_anchor2shard(args->dkey_anchor) /
obj_get_replicas(obj);
}

if (grp_idx < 0) {
Expand Down

0 comments on commit 234cb1f

Please sign in to comment.