Bart Van Assche
624fa7790f
scsi: klist: Make it safe to use klists in atomic context
...
In the scsi_transport_srp implementation it cannot be avoided to
iterate over a klist from atomic context when using the legacy block
layer instead of blk-mq. Hence this patch that makes it safe to use
klists in atomic context. This patch avoids that lockdep reports the
following:
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
Possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&(&k->k_lock)->rlock);
local_irq_disable();
lock(&(&q->__queue_lock)->rlock);
lock(&(&k->k_lock)->rlock);
<Interrupt>
lock(&(&q->__queue_lock)->rlock);
stack backtrace:
Workqueue: kblockd blk_timeout_work
Call Trace:
dump_stack+0xa4/0xf5
check_usage+0x6e6/0x700
__lock_acquire+0x185d/0x1b50
lock_acquire+0xd2/0x260
_raw_spin_lock+0x32/0x50
klist_next+0x47/0x190
device_for_each_child+0x8e/0x100
srp_timed_out+0xaf/0x1d0 [scsi_transport_srp]
scsi_times_out+0xd4/0x410 [scsi_mod]
blk_rq_timed_out+0x36/0x70
blk_timeout_work+0x1b5/0x220
process_one_work+0x4fe/0xad0
worker_thread+0x63/0x5a0
kthread+0x1c1/0x1e0
ret_from_fork+0x24/0x30
See also commit c9ddf73476ff ("scsi: scsi_transport_srp: Fix shost to
rport translation").
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: James Bottomley <jejb@linux.vnet.ibm.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-07-02 16:20:23 -04:00
..
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:25 -07:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2018-04-07 12:08:19 -07:00
2018-06-12 16:19:22 -07:00
2017-10-12 15:10:12 +02:00
2017-05-08 17:15:12 -07:00
2018-03-26 02:01:27 +09:00
2018-06-12 16:19:22 -07:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2017-12-08 15:13:27 +00:00
2017-12-04 10:52:56 -08:00
2017-07-14 15:05:13 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-06-07 17:34:39 -07:00
2017-07-10 16:32:35 -07:00
2018-03-14 16:55:29 -07:00
2018-06-07 17:34:38 -07:00
2018-03-09 16:40:01 -08:00
2017-11-02 11:10:55 +01:00
2018-01-12 23:03:01 +11:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-08 18:26:49 -07:00
2017-12-01 13:09:40 -08:00
2017-11-02 11:10:55 +01:00
2018-02-06 18:32:44 -08:00
2017-09-26 15:01:20 -06:00
2017-09-26 15:01:20 -06:00
2017-09-26 15:01:20 -06:00
2017-11-02 11:10:55 +01:00
2017-02-24 17:46:57 -08:00
2018-01-08 10:08:33 +00:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-14 20:20:01 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-02-24 17:46:57 -08:00
2017-11-02 11:10:55 +01:00
2018-03-15 18:08:55 +01:00
2017-10-12 17:16:40 +01:00
2017-11-13 08:25:06 -08:00
2018-05-24 09:24:17 +02:00
2018-05-31 18:35:36 +02:00
2018-05-19 08:46:12 +02:00
2017-11-02 11:10:55 +01:00
2018-03-15 13:25:36 +01:00
2017-11-17 16:10:01 -08:00
2017-11-15 11:56:19 -08:00
2018-01-12 17:33:38 -08:00
2018-04-27 08:51:26 -04:00
2017-07-10 16:32:35 -07:00
2017-08-10 15:54:06 -07:00
2018-05-11 17:28:45 -07:00
2018-02-06 18:32:44 -08:00
2017-11-02 11:10:55 +01:00
2017-10-07 10:45:14 -06:00
2017-11-02 11:10:55 +01:00
2017-11-17 16:10:02 -08:00
2017-02-24 17:46:57 -08:00
2017-02-24 17:46:57 -08:00
2017-09-08 18:26:49 -07:00
2017-11-02 11:10:55 +01:00
2018-06-07 17:34:39 -07:00
2017-11-02 11:10:55 +01:00
2018-02-04 10:17:21 +00:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-05-09 06:55:44 +02:00
2018-03-22 17:07:01 -07:00
2018-06-08 15:16:44 -07:00
2017-11-02 11:10:55 +01:00
2017-03-02 08:42:38 +01:00
2017-11-02 11:10:55 +01:00
2018-06-15 18:10:01 -03:00
2018-06-15 07:55:24 +09:00
2018-02-06 18:32:47 -08:00
2017-05-16 08:44:22 -03:00
2018-04-11 10:28:35 -07:00
2018-06-12 16:19:22 -07:00
2018-07-02 16:20:23 -04:00
2018-05-01 10:22:41 -04:00
2018-04-23 13:14:55 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-26 15:09:38 +02:00
2018-04-11 10:28:35 -07:00
2017-11-02 11:10:55 +01:00
2017-10-25 11:01:08 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-12 09:41:19 -07:00
2018-03-21 17:18:34 -05:00
2018-06-12 16:19:22 -07:00
2017-12-01 13:09:40 -08:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2017-12-01 13:09:40 -08:00
2017-11-02 11:10:55 +01:00
2017-12-07 14:00:57 -05:00
2017-11-17 16:10:02 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-08 15:13:28 +00:00
2017-11-04 09:26:51 +09:00
2017-02-03 16:35:42 -05:00
2016-12-06 10:17:03 +02:00
2018-01-26 11:45:16 -06:00
2017-11-02 11:10:55 +01:00
2018-03-19 10:09:44 -07:00
2017-03-02 08:42:27 +01:00
2017-01-23 09:17:12 +01:00
2018-05-25 18:12:10 -07:00
2017-11-21 15:57:05 -08:00
2017-10-03 17:54:26 -07:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-12-14 16:00:48 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-24 13:21:46 -04:00
2018-06-12 16:19:22 -07:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-13 17:10:28 -07:00
2017-02-22 16:41:30 -08:00
2017-01-09 13:58:57 -05:00
2018-01-05 15:24:00 +01:00
2017-11-02 11:10:55 +01:00
2018-02-06 18:32:44 -08:00
2017-09-13 18:53:16 -07:00
2018-02-01 12:20:21 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-06-04 10:58:12 -07:00
2017-11-02 11:10:55 +01:00
2018-05-18 17:17:12 -07:00
2018-06-03 07:42:06 -07:00
2017-09-08 18:26:49 -07:00
2018-06-12 16:19:22 -07:00
2018-04-11 10:28:32 -07:00
2018-06-12 16:19:22 -07:00
2017-11-17 16:10:01 -08:00
2018-06-12 16:19:22 -07:00
2017-02-26 11:03:38 -05:00
2018-06-15 07:55:25 +09:00
2018-06-12 16:19:22 -07:00
2017-01-09 13:58:57 -05:00
2018-02-06 18:32:45 -08:00
2017-11-17 16:10:01 -08:00
2017-07-12 16:26:00 -07:00
2018-04-11 10:28:35 -07:00
2018-03-26 15:55:57 +02:00
2017-07-21 09:38:30 +02:00
2018-04-16 18:53:13 -04:00
2017-12-29 23:13:10 +01:00
2017-10-22 03:14:07 +01:00
2017-10-22 03:14:07 +01:00
2018-02-06 18:32:46 -08:00
2018-02-06 18:32:46 -08:00
2018-04-23 16:39:35 +01:00
2018-06-07 17:34:39 -07:00
2017-12-11 09:35:11 -05:00
2017-12-11 15:03:08 -07:00
2018-06-06 16:04:55 -07:00
2017-11-02 11:10:55 +01:00
2017-08-15 09:02:07 -07:00