Michal Hocko
4f402ee592
scsi: fix scsi_error_handler vs. scsi_host_dev_release race
...
commit 537b604c8b upstream.
b9d5c6b7ef ("[SCSI] cleanup setting task state in
scsi_error_handler()") has introduced a race between scsi_error_handler
and scsi_host_dev_release resulting in the hang when the device goes
away because scsi_error_handler might miss a wake up:
CPU0 CPU1
scsi_error_handler scsi_host_dev_release
kthread_stop()
kthread_should_stop()
test_bit(KTHREAD_SHOULD_STOP)
set_bit(KTHREAD_SHOULD_STOP)
wake_up_process()
wait_for_completion()
set_current_state(TASK_INTERRUPTIBLE)
schedule()
The most straightforward solution seems to be to invert the ordering of
the set_current_state and kthread_should_stop.
The issue has been noticed during reboot test on a 3.0 based kernel but
the current code seems to be affected in the same way.
[jejb: additional comment added]
Reported-and-debugged-by: Mike Mayer <Mike.Meyer@teradata.com >
Signed-off-by: Michal Hocko <mhocko@suse.com >
Reviewed-by: Dan Williams <dan.j.williams@intel.com >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Signed-off-by: James Bottomley <JBottomley@Odin.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2015-10-22 14:37:49 -07:00
..
2013-12-11 22:36:28 -08:00
2013-04-09 14:13:26 -04:00
2013-04-09 14:13:28 -04:00
2013-05-10 07:47:52 -07:00
2014-05-06 07:55:30 -07:00
2013-04-09 14:13:27 -04:00
2015-04-19 10:10:50 +02:00
2014-09-17 09:03:59 -07:00
2014-12-06 15:05:49 -08:00
2013-04-24 16:43:00 +02:00
2013-05-02 07:37:10 -07:00
2013-01-30 11:58:06 +11:00
2013-04-11 16:00:31 -07:00
2011-07-26 16:49:47 -07:00
2013-06-26 23:08:22 -07:00
2013-06-16 08:10:53 -10:00
2014-07-09 11:13:59 -07:00
2014-03-23 21:38:19 -07:00
2015-09-13 09:07:59 -07:00
2015-03-26 15:01:00 +01:00
2015-06-29 12:08:34 -07:00
2015-01-08 09:58:15 -08:00
2014-05-13 13:59:41 +02:00
2013-09-26 17:18:01 -07:00
2015-05-06 21:56:27 +02:00
2013-07-13 11:42:26 -07:00
2013-04-09 14:13:21 -04:00
2013-09-07 22:09:58 -07:00
2015-08-03 09:29:47 -07:00
2013-05-10 07:47:53 -07:00
2014-07-09 11:14:03 -07:00
2013-05-02 16:16:50 -07:00
2015-05-13 05:15:42 -07:00
2015-05-13 05:15:42 -07:00
2015-05-13 05:15:42 -07:00
2015-05-13 05:15:42 -07:00
2015-05-13 05:15:42 -07:00
2015-05-13 05:15:42 -07:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:03 +01:00
2011-03-31 11:26:23 -03:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:15 -04:00
2010-05-26 19:51:07 +02:00
2013-04-09 14:13:15 -04:00
2010-05-26 19:51:07 +02:00
2010-05-26 19:51:09 +02:00
2013-04-09 14:13:22 -04:00
2013-04-09 14:13:22 -04:00
2012-06-28 11:44:36 +02:00
2010-11-16 13:33:23 -08:00
2013-04-09 14:13:23 -04:00
2013-04-09 14:13:28 -04:00
2013-04-09 14:13:29 -04:00
2013-04-09 14:13:29 -04:00
2013-04-09 14:13:29 -04:00
2013-04-09 14:13:24 -04:00
2013-04-09 14:13:19 -04:00
2013-04-09 14:13:19 -04:00
2013-01-03 15:57:01 -08:00
2013-02-27 19:10:18 -08:00
2012-09-14 11:58:53 +01:00
2013-04-09 14:13:24 -04:00
2011-03-31 11:26:23 -03:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:24 -04:00
2010-11-16 13:33:23 -08:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:23 -04:00
2011-05-01 10:22:40 -05:00
2013-10-13 16:08:32 -07:00
2013-10-13 16:08:32 -07:00
2013-01-03 15:57:01 -08:00
2011-03-31 11:26:23 -03:00
2013-04-09 14:13:17 -04:00
2010-11-16 13:33:23 -08:00
2010-01-18 10:48:16 -06:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:16 -04:00
2013-12-11 22:36:28 -08:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:15 -04:00
2010-05-26 19:51:08 +02:00
2013-12-11 22:36:28 -08:00
2012-05-10 09:19:39 +01:00
2015-07-03 19:48:09 -07:00
2012-05-10 09:19:39 +01:00
2013-01-03 15:57:01 -08:00
2012-11-27 08:59:43 +04:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:25 -04:00
2010-11-16 13:33:23 -08:00
2013-01-03 15:57:01 -08:00
2011-03-31 11:26:23 -03:00
2015-08-16 20:51:36 -07:00
2015-08-16 20:51:36 -07:00
2013-12-11 22:36:28 -08:00
2013-04-09 14:13:27 -04:00
2012-01-03 22:54:55 -05:00
2013-04-11 16:55:04 -07:00
2011-02-24 12:41:10 -05:00
2013-01-03 15:57:01 -08:00
2013-08-29 09:47:39 -07:00
2013-01-03 15:57:01 -08:00
2012-03-22 12:55:29 -07:00
2014-10-05 14:54:12 -07:00
2011-10-31 19:31:24 -04:00
2012-03-28 18:30:03 +01:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2012-12-01 10:09:17 +00:00
2013-12-11 22:36:28 -08:00
2013-04-29 15:41:57 -04:00
2012-03-28 18:30:03 +01:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:15 -04:00
2010-05-02 15:55:03 -04:00
2013-04-15 14:30:44 -06:00
2013-04-15 14:30:44 -06:00
2012-03-28 18:30:03 +01:00
2010-11-16 13:33:23 -08:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2011-05-10 10:16:21 +02:00
2013-08-14 22:59:10 -07:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:03 +01:00
2011-03-31 11:26:23 -03:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-12-11 22:36:28 -08:00
2012-02-21 11:40:37 +01:00
2013-04-09 14:13:17 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2010-08-06 09:25:50 -06:00
2010-03-03 21:17:06 +05:30
2013-05-10 07:53:40 -07:00
2012-09-24 12:11:00 +04:00
2015-10-22 14:37:49 -07:00
2011-10-31 19:31:23 -04:00
2015-04-19 10:10:49 +02:00
2014-06-26 15:12:37 -04:00
2013-05-06 12:48:31 -07:00
2012-07-20 09:05:54 +01:00
2013-05-31 15:16:51 -04:00
2010-02-08 17:15:19 -06:00
2014-05-30 21:52:11 -07:00
2014-05-30 21:52:11 -07:00
2011-10-31 19:31:23 -04:00
2011-05-01 10:20:10 -05:00
2011-05-24 12:38:36 -04:00
2013-03-28 14:27:24 -04:00
2013-05-10 07:47:53 -07:00
2012-12-01 10:08:41 +00:00
2012-05-10 09:06:12 +01:00
2012-11-30 17:40:33 -08:00
2013-08-14 22:59:04 -07:00
2012-01-03 22:54:07 -05:00
2013-05-02 15:37:03 -07:00
2014-01-15 15:28:53 -08:00
2013-07-25 14:07:30 -07:00
2011-06-29 12:14:25 -05:00
2015-08-16 20:51:41 -07:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2011-10-31 19:31:24 -04:00
2010-03-30 22:02:32 +09:00
2013-05-07 02:16:21 -04:00
2011-07-21 14:15:58 -07:00
2015-08-10 12:20:30 -07:00
2012-09-14 17:59:29 +01:00
2013-01-03 15:57:01 -08:00
2015-05-06 21:56:26 +02:00
2013-05-04 14:50:16 -04:00
2012-03-28 18:30:03 +01:00
2013-05-04 14:50:16 -04:00
2013-05-04 14:50:16 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2010-11-16 13:33:23 -08:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-01-03 15:57:01 -08:00
2012-03-28 18:30:03 +01:00
2012-03-28 18:30:03 +01:00
2010-11-16 13:33:23 -08:00
2014-07-09 11:13:59 -07:00
2013-01-03 15:57:01 -08:00
2012-03-27 08:26:36 +01:00
2013-04-09 14:13:15 -04:00
2013-04-09 14:13:15 -04:00
2013-04-09 14:13:15 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00