Only advance the zap cursor when ozi_pos is not advanced, otherwise
occasionally the a file could get "lost" because the zap_cursor would
advance over it before the retrieve happened.
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Iad560e2ffb4cfe2c74a1cf9197be7c2537538822
Reviewed-on: http://review.whamcloud.com/12582
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
zap_attribute_t *za = &osd_oti_get(env)->oti_za;
int rc;
zap_attribute_t *za = &osd_oti_get(env)->oti_za;
int rc;
/* temp. storage should be enough for any key supported by ZFS */
CLASSERT(sizeof(za->za_name) <= sizeof(it->ozi_name));
/* temp. storage should be enough for any key supported by ZFS */
CLASSERT(sizeof(za->za_name) <= sizeof(it->ozi_name));
it->ozi_pos++;
if (it->ozi_pos <=2)
RETURN(0);
it->ozi_pos++;
if (it->ozi_pos <=2)
RETURN(0);
- zap_cursor_advance(it->ozi_zc);
+ } else {
+ zap_cursor_advance(it->ozi_zc);
+ }
/*
* According to current API we need to return error if its last entry.
/*
* According to current API we need to return error if its last entry.