From: Alex Zhuravlev Date: Tue, 11 Feb 2014 10:06:47 +0000 (+0400) Subject: LU-4543 osd: return actual hash value for a record X-Git-Tag: 2.5.56~40 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8a861ac9c27bac9f68ebe540e34ae3e44da638d0;ds=sidebyside LU-4543 osd: return actual hash value for a record hash value should be fetched only once we've got a record. Signed-off-by: Alex Zhuravlev Change-Id: If02a5ba0c85c0230dea799445a8b985ed1a6fbae Reviewed-on: http://review.whamcloud.com/9218 Tested-by: Jenkins Reviewed-by: Nathaniel Clark Tested-by: Maloo Reviewed-by: Isaac Huang Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-zfs/osd_index.c b/lustre/osd-zfs/osd_index.c index 40167bb..1e7c441 100644 --- a/lustre/osd-zfs/osd_index.c +++ b/lustre/osd-zfs/osd_index.c @@ -932,11 +932,11 @@ static int osd_dir_it_rec(const struct lu_env *env, const struct dt_it *di, LASSERT(lde); - lde->lde_hash = cpu_to_le64(udmu_zap_cursor_serialize(it->ozi_zc)); - - if ((rc = -zap_cursor_retrieve(it->ozi_zc, za))) + rc = -zap_cursor_retrieve(it->ozi_zc, za); + if (unlikely(rc != 0)) GOTO(out, rc); + lde->lde_hash = cpu_to_le64(udmu_zap_cursor_serialize(it->ozi_zc)); namelen = strlen(za->za_name); if (namelen > NAME_MAX) GOTO(out, rc = -EOVERFLOW);