Quinn Tran 4c2a2d0178 scsi: qla2xxx: Fix NVME cmd and LS cmd timeout race condition
This patch uses kref to protect access between fcp_abort path and nvme
command and LS command completion path.  Stack trace below shows the abort
path is accessing stale memory (nvme_private->sp).

When command kref reaches 0, nvme_private & srb resource will be
disconnected from each other.  Any subsequence nvme abort request will not
be able to reference the original srb.

[ 5631.003998] BUG: unable to handle kernel paging request at 00000010000005d8
[ 5631.004016] IP: [<ffffffffc087df92>] qla_nvme_abort_work+0x22/0x100 [qla2xxx]
[ 5631.004086] Workqueue: events qla_nvme_abort_work [qla2xxx]
[ 5631.004097] RIP: 0010:[<ffffffffc087df92>]  [<ffffffffc087df92>] qla_nvme_abort_work+0x22/0x100 [qla2xxx]
[ 5631.004109] Call Trace:
[ 5631.004115]  [<ffffffffaa4b8174>] ? pwq_dec_nr_in_flight+0x64/0xb0
[ 5631.004117]  [<ffffffffaa4b9d4f>] process_one_work+0x17f/0x440
[ 5631.004120]  [<ffffffffaa4bade6>] worker_thread+0x126/0x3c0

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-06-27 00:09:18 -04:00
..
2018-12-18 23:19:21 -05:00
2019-05-08 10:12:46 -07:00
2019-05-08 10:12:46 -07:00
2019-03-09 16:53:47 -08:00
2019-05-21 06:16:22 -04:00
2019-05-21 06:16:22 -04:00
2019-06-18 19:46:23 -04:00
2019-05-08 10:12:46 -07:00
2019-03-02 11:39:54 -08:00
2018-12-18 23:19:21 -05:00
2018-12-18 23:19:21 -05:00
2018-06-19 22:02:25 -04:00
2018-12-18 23:19:21 -05:00
2019-06-18 19:46:23 -04:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:58:35 -05:00
2018-12-18 23:19:21 -05:00
2019-06-18 19:46:18 -04:00
2019-06-18 19:46:18 -04:00
2018-12-18 23:19:21 -05:00
2018-11-06 21:31:28 -05:00
2019-05-21 06:16:22 -04:00
2018-12-18 23:19:21 -05:00
2018-12-28 14:48:06 -08:00
2019-03-09 16:53:47 -08:00
2018-06-19 22:02:25 -04:00
2019-06-18 19:46:17 -04:00
2019-02-12 22:33:00 -05:00
2019-05-21 06:16:23 -04:00
2019-05-21 06:16:23 -04:00
2018-12-18 23:19:21 -05:00
2019-05-21 06:16:23 -04:00
2019-06-18 19:46:18 -04:00
2018-12-18 23:19:21 -05:00
2018-12-28 14:48:06 -08:00
2019-06-20 15:37:02 -04:00