Ming Lei
6280db912e
scsi: core: Don't start concurrent async scan on same host
...
[ Upstream commit 831e3405c2a344018a18fcc2665acc5a38c3a707 ]
The current scanning mechanism is supposed to fall back to a synchronous
host scan if an asynchronous scan is in progress. However, this rule isn't
strictly respected, scsi_prep_async_scan() doesn't hold scan_mutex when
checking shost->async_scan. When scsi_scan_host() is called concurrently,
two async scans on same host can be started and a hang in do_scan_async()
is observed.
Fixes this issue by checking & setting shost->async_scan atomically with
shost->scan_mutex.
Link: https://lore.kernel.org/r/20201010032539.426615-1-ming.lei@redhat.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ewan D. Milne <emilne@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-11-10 12:35:59 +01:00
..
2020-10-01 13:14:42 +02:00
2020-02-24 08:34:43 +01:00
2019-02-12 19:47:25 +01:00
2019-11-24 08:20:59 +01:00
2020-08-19 08:14:55 +02:00
2020-10-29 09:55:14 +01:00
2020-01-14 20:07:06 +01:00
2019-06-19 08:18:03 +02:00
2020-01-23 08:21:38 +01:00
2020-10-29 09:55:07 +01:00
2020-01-17 19:47:14 +01:00
2020-10-01 13:14:45 +02:00
2019-11-10 11:27:20 +01:00
2020-01-23 08:21:38 +01:00
2020-09-03 11:24:22 +02:00
2020-10-01 13:14:26 +02:00
2020-06-07 13:17:55 +02:00
2020-10-30 10:38:30 +01:00
2018-09-17 02:50:37 -04:00
2019-12-01 09:16:28 +01:00
2020-10-01 13:14:48 +02:00
2020-09-17 13:45:23 +02:00
2020-10-01 13:14:33 +02:00
2020-06-22 09:05:07 +02:00
2020-06-25 15:32:55 +02:00
2018-03-01 21:07:48 -05:00
2018-08-21 23:54:17 -04:00
2018-03-19 22:54:47 -04:00
2020-10-01 13:14:28 +02:00
2020-06-25 15:32:53 +02:00
2020-10-30 10:38:31 +01:00
2020-11-05 11:08:47 +01:00
2020-10-29 09:55:07 +01:00
2020-04-29 16:31:16 +02:00
2018-07-12 23:01:16 -04:00
2019-11-20 18:46:29 +01:00
2020-10-30 10:38:32 +01:00
2017-10-25 05:40:22 -04:00
2018-07-30 23:17:53 -04:00
2017-12-04 20:32:53 -05:00
2018-07-30 23:17:53 -04:00
2018-07-30 23:17:53 -04:00
2019-03-13 14:02:31 -07:00
2017-11-02 11:10:55 +01:00
2018-07-30 23:17:53 -04:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-05-01 23:29:41 -04:00
2020-01-04 19:12:56 +01:00
2018-07-30 23:17:53 -04:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2019-10-29 09:19:50 +01:00
2017-11-02 11:10:55 +01:00
2019-12-01 09:16:32 +01:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:11 -04:00
2018-05-18 12:03:51 -04:00
2018-03-15 00:25:37 -04:00
2018-11-13 11:08:32 -08:00
2018-11-13 11:08:32 -08:00
2017-08-25 17:21:11 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2017-08-25 17:21:10 -04:00
2017-11-02 11:10:55 +01:00
2018-08-27 13:17:00 -04:00
2019-07-10 09:53:37 +02:00
2020-10-01 13:14:40 +02:00
2018-07-10 22:25:03 -04:00
2017-08-25 17:21:10 -04:00
2018-06-26 12:27:07 -04:00
2017-11-02 11:10:55 +01:00
2020-04-02 15:28:15 +02:00
2020-04-02 15:28:15 +02:00
2019-12-01 09:16:26 +01:00
2018-04-20 19:40:17 -04:00
2020-06-25 15:33:01 +02:00
2020-02-24 08:34:48 +01:00
2018-03-12 22:05:43 -04:00
2020-07-22 09:32:04 +02:00
2017-08-22 16:34:36 +02:00
2018-06-19 22:02:25 -04:00
2019-12-21 10:57:41 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:08:32 -08:00
2020-01-04 19:12:56 +01:00
2018-08-15 22:06:26 -07:00
2019-10-29 09:19:29 +01:00
2018-06-19 22:02:25 -04:00
2020-08-19 08:14:59 +02:00
2017-11-02 11:10:55 +01:00
2018-03-19 22:54:47 -04:00
2017-11-02 11:10:55 +01:00
2020-10-30 10:38:28 +01:00
2018-07-10 22:42:47 -04:00
2020-01-04 19:13:04 +01:00
2019-11-20 18:47:49 +01:00
2018-06-19 22:02:25 -04:00
2017-10-16 22:38:44 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2018-02-13 21:49:15 -05:00
2017-12-04 20:32:52 -05:00
2017-11-02 11:10:55 +01:00
2017-10-05 15:01:17 +02:00
2017-10-05 15:01:17 +02:00
2017-08-25 17:21:11 -04:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:21:11 -04:00
2018-06-26 12:53:26 -04:00
2017-11-02 11:10:55 +01:00
2018-12-19 19:19:49 +01:00
2017-12-11 21:39:39 -05:00
2020-08-19 08:14:57 +02:00
2018-04-20 19:14:28 -04:00
2019-05-08 07:21:49 +02:00
2019-05-08 07:21:49 +02:00
2019-10-29 09:19:49 +01:00
2018-06-26 12:27:06 -04:00
2017-11-02 11:10:55 +01:00
2019-11-20 18:45:10 +01:00
2019-10-07 18:57:04 +02:00
2017-11-14 16:23:44 -08:00
2019-01-22 21:40:32 +01:00
2017-12-07 21:13:45 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-11-10 12:35:59 +01:00
2019-10-29 09:19:50 +01:00
2020-01-23 08:21:38 +01:00
2017-11-02 11:10:55 +01:00
2018-08-15 22:06:26 -07:00
2020-09-03 11:24:22 +02:00
2018-06-10 13:01:12 -07:00
2020-07-29 10:16:45 +02:00
2018-06-04 07:58:06 -07:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-07-30 08:27:02 -06:00
2018-08-15 22:06:26 -07:00
2020-04-02 15:28:17 +02:00
2018-07-30 08:27:02 -06:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2020-05-20 08:18:34 +02:00
2017-08-25 17:21:10 -04:00
2019-11-10 11:27:21 +01:00
2018-08-02 15:22:13 -06:00
2020-07-22 09:32:04 +02:00
2020-06-25 15:32:52 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-08-08 21:15:54 -04:00
2017-11-02 11:10:55 +01:00
2019-05-08 07:21:49 +02:00
2020-01-04 19:12:56 +01:00
2018-03-12 22:05:43 -04:00
2019-03-23 20:09:59 +01:00
2019-07-03 13:14:45 +02:00
2017-08-25 17:21:10 -04:00
2018-05-01 23:30:12 -04:00
2017-11-02 11:10:55 +01:00
2018-06-19 14:54:41 +02:00
2019-12-17 20:36:03 +01:00