We assert atomic_t value with hard coded 0x5a5a5a in several places,
which could result in false assertion failure when the reference count
getting very large in some extreme case.
The hard coded 0x5a5a5a should be replaced by LI_POISON.
Signed-off-by: Bruno Faccini <bruno.faccini@bull.net>
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Idc271621017d071b3e2dce5d0ec6fb854127a955
Reviewed-on: http://review.whamcloud.com/1953
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
{
if (ctxt == NULL)
return;
{
if (ctxt == NULL)
return;
- LASSERT_ATOMIC_GT_LT(&ctxt->loc_refcount, 0, 0x5a5a5a);
+ LASSERT_ATOMIC_GT_LT(&ctxt->loc_refcount, 0, LI_POISON);
CDEBUG(D_INFO, "PUTting ctxt %p : new refcount %d\n", ctxt,
cfs_atomic_read(&ctxt->loc_refcount) - 1);
__llog_ctxt_put(ctxt);
CDEBUG(D_INFO, "PUTting ctxt %p : new refcount %d\n", ctxt,
cfs_atomic_read(&ctxt->loc_refcount) - 1);
__llog_ctxt_put(ctxt);
void class_export_put(struct obd_export *exp)
{
LASSERT(exp != NULL);
void class_export_put(struct obd_export *exp)
{
LASSERT(exp != NULL);
- LASSERT_ATOMIC_GT_LT(&exp->exp_refcount, 0, 0x5a5a5a);
+ LASSERT_ATOMIC_GT_LT(&exp->exp_refcount, 0, LI_POISON);
CDEBUG(D_INFO, "PUTting export %p : new refcount %d\n", exp,
cfs_atomic_read(&exp->exp_refcount) - 1);
CDEBUG(D_INFO, "PUTting export %p : new refcount %d\n", exp,
cfs_atomic_read(&exp->exp_refcount) - 1);
ENTRY;
LASSERT(cfs_list_empty(&imp->imp_zombie_chain));
ENTRY;
LASSERT(cfs_list_empty(&imp->imp_zombie_chain));
- LASSERT_ATOMIC_GE_LT(&imp->imp_refcount, 0, 0x5a5a5a);
+ LASSERT_ATOMIC_GT_LT(&imp->imp_refcount, 0, LI_POISON);
CDEBUG(D_INFO, "import %p refcount=%d obd=%s\n", imp,
cfs_atomic_read(&imp->imp_refcount) - 1,
CDEBUG(D_INFO, "import %p refcount=%d obd=%s\n", imp,
cfs_atomic_read(&imp->imp_refcount) - 1,
/*
* Banlance the ctxt get when calling llog_cleanup()
*/
/*
* Banlance the ctxt get when calling llog_cleanup()
*/
- LASSERT(cfs_atomic_read(&ctxt->loc_refcount) < 0x5a5a5a);
+ LASSERT(cfs_atomic_read(&ctxt->loc_refcount) < LI_POISON);
LASSERT(cfs_atomic_read(&ctxt->loc_refcount) > 1);
llog_ctxt_put(ctxt);
LASSERT(cfs_atomic_read(&ctxt->loc_refcount) > 1);
llog_ctxt_put(ctxt);