qla2xxx-32gbit: Complain loudly about reference count underflow

A reference count underflow is a severe bug. Hence complain loudly if a
reference count underflow happens.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8302 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-05-01 23:19:24 +00:00
parent f227304e06
commit 1ef60963cc

View File

@@ -142,7 +142,7 @@ static void qla_nvme_sp_ls_done(void *ptr, int res)
struct nvmefc_ls_req *fd;
struct nvme_private *priv;
if (WARN_ON(atomic_read(&sp->ref_count) == 0))
if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
return;
atomic_dec(&sp->ref_count);
@@ -168,7 +168,7 @@ static void qla_nvme_sp_done(void *ptr, int res)
nvme = &sp->u.iocb_cmd;
fd = nvme->u.nvme.desc;
if (WARN_ON(atomic_read(&sp->ref_count) == 0))
if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
return;
atomic_dec(&sp->ref_count);
@@ -210,13 +210,8 @@ static void qla_nvme_abort_work(struct work_struct *work)
return;
}
if (atomic_read(&sp->ref_count) == 0) {
WARN_ON(1);
ql_log(ql_log_info, fcport->vha, 0xffff,
"%s: command already aborted on sp: %p\n",
__func__, sp);
if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
return;
}
rval = ha->isp_ops->abort_command(sp);