Whamcloud - gitweb
LU-4543 osd: return actual hash value for a record 18/9218/3
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Tue, 11 Feb 2014 10:06:47 +0000 (14:06 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 18 Feb 2014 18:13:22 +0000 (18:13 +0000)
hash value should be fetched only once we've got a record.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: If02a5ba0c85c0230dea799445a8b985ed1a6fbae
Reviewed-on: http://review.whamcloud.com/9218
Tested-by: Jenkins
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_index.c

index 40167bb..1e7c441 100644 (file)
@@ -932,11 +932,11 @@ static int osd_dir_it_rec(const struct lu_env *env, const struct dt_it *di,
 
        LASSERT(lde);
 
 
        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);
 
                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);
        namelen = strlen(za->za_name);
        if (namelen > NAME_MAX)
                GOTO(out, rc = -EOVERFLOW);