diff options
author | Bart Van Assche | 2019-04-17 14:44:40 -0700 |
---|---|---|
committer | Martin K. Petersen | 2019-04-29 17:24:51 -0400 |
commit | db4bf822c58cd2b4a6718c982ce48a5292f5cc6a (patch) | |
tree | bb9d2577cd354b067966afc3c6428821cea74f1c /drivers/scsi/qla2xxx/qla_os.c | |
parent | d4556a4932a54613fd766df6879e39d0342f49a0 (diff) |
scsi: qla2xxx: Complain loudly about reference count underflow
A reference count underflow is a severe bug. Hence complain loudly if a
reference count underflow happens.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 73ddd02d1a39..e1c82a0a9745 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -716,14 +716,8 @@ qla2x00_sp_compl(void *ptr, int res) struct scsi_cmnd *cmd = GET_CMD_SP(sp); struct completion *comp = sp->comp; - if (atomic_read(&sp->ref_count) == 0) { - ql_dbg(ql_dbg_io, sp->vha, 0x3015, - "SP reference-count to ZERO -- sp=%p cmd=%p.\n", - sp, GET_CMD_SP(sp)); - if (ql2xextended_error_logging & ql_dbg_io) - WARN_ON(atomic_read(&sp->ref_count) == 0); + if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0)) return; - } atomic_dec(&sp->ref_count); @@ -827,14 +821,8 @@ qla2xxx_qpair_sp_compl(void *ptr, int res) struct scsi_cmnd *cmd = GET_CMD_SP(sp); struct completion *comp = sp->comp; - if (atomic_read(&sp->ref_count) == 0) { - ql_dbg(ql_dbg_io, sp->fcport->vha, 0x3079, - "SP reference-count to ZERO -- sp=%p cmd=%p.\n", - sp, GET_CMD_SP(sp)); - if (ql2xextended_error_logging & ql_dbg_io) - WARN_ON(atomic_read(&sp->ref_count) == 0); + if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0)) return; - } atomic_dec(&sp->ref_count); |