need to assign exp_nid_stats even if old stats are present
Change-Id: I9b0ac4c7ccee6cbd457827b20123bf40d91aaf33
Xyratex-bug-id: MRP-1641
Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-on: http://review.whamcloud.com/9171
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
/* Return -EALREADY here so that we know that the /proc
* entry already has been created */
if (old_stat != new_stat) {
- nidstat_putref(old_stat);
+ spin_lock(&exp->exp_lock);
+ if (exp->exp_nid_stats) {
+ LASSERT(exp->exp_nid_stats == old_stat);
+ nidstat_putref(exp->exp_nid_stats);
+ }
+ exp->exp_nid_stats = old_stat;
+ spin_unlock(&exp->exp_lock);
GOTO(destroy_new, rc = -EALREADY);
}
/* not found - create */