Martin Peschke
db59af9637
zfcp: fix lock imbalance by reworking request queue locking
...
commit d79ff14262 upstream.
This patch adds wait_event_interruptible_lock_irq_timeout(), which is a
straight-forward descendant of wait_event_interruptible_timeout() and
wait_event_interruptible_lock_irq().
The zfcp driver used to call wait_event_interruptible_timeout()
in combination with some intricate and error-prone locking. Using
wait_event_interruptible_lock_irq_timeout() as a replacement
nicely cleans up that locking.
This rework removes a situation that resulted in a locking imbalance
in zfcp_qdio_sbal_get():
BUG: workqueue leaked lock or atomic: events/1/0xffffff00/10
last function: zfcp_fc_wka_port_offline+0x0/0xa0 [zfcp]
It was introduced by commit c2af7545aa
"[SCSI] zfcp: Do not wait for SBALs on stopped queue", which had a new
code path related to ZFCP_STATUS_ADAPTER_QDIOUP that took an early exit
without a required lock being held. The problem occured when a
special, non-SCSI I/O request was being submitted in process context,
when the adapter's queues had been torn down. In this case the bug
surfaced when the Fibre Channel port connection for a well-known address
was closed during a concurrent adapter shut-down procedure, which is a
rare constellation.
This patch also fixes these warnings from the sparse tool (make C=1):
drivers/s390/scsi/zfcp_qdio.c:224:12: warning: context imbalance in
'zfcp_qdio_sbal_check' - wrong count at exit
drivers/s390/scsi/zfcp_qdio.c:244:5: warning: context imbalance in
'zfcp_qdio_sbal_get' - unexpected unlock
Last but not least, we get rid of that crappy lock-unlock-lock
sequence at the beginning of the critical section.
It is okay to call zfcp_erp_adapter_reopen() with req_q_lock held.
Reported-by: Mikulas Patocka <mpatocka@redhat.com >
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com >
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com >
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com >
Signed-off-by: James Bottomley <JBottomley@Parallels.com >
Signed-off-by: Ben Hutchings <ben@decadent.org.uk >
2013-09-10 01:57:28 +01:00
..
2011-11-04 18:02:25 -07:00
2011-10-31 19:32:32 -04:00
2011-11-11 09:50:19 -08:00
2011-11-03 09:40:51 -07:00
2012-08-19 18:15:34 +01:00
2012-08-19 18:15:33 +01:00
2011-11-01 10:51:38 -07:00
2012-09-19 15:04:40 +01:00
2012-10-30 23:26:28 +00:00
2012-10-30 23:26:26 +00:00
2011-11-01 09:19:52 +01:00
2011-11-09 15:07:40 +01:00
2011-10-31 17:30:55 -07:00
2011-11-06 19:44:47 -08:00
2011-10-31 17:30:54 -07:00
2011-10-31 19:32:32 -04:00
2012-11-16 16:46:48 +00:00
2013-04-25 20:22:10 +01:00
2011-10-31 19:32:32 -04:00
2012-07-12 04:32:18 +01:00
2013-04-25 20:25:31 +01:00
2011-10-31 17:30:54 -07:00
2013-03-06 03:24:19 +00:00
2013-03-06 03:24:28 +00:00
2013-09-10 01:57:27 +01:00
2012-02-20 12:46:20 -08:00
2012-08-02 14:37:54 +01:00
2011-10-31 17:30:54 -07:00
2013-07-27 05:34:20 +01:00
2011-12-19 11:41:40 +01:00
2011-10-31 17:30:49 -07:00
2012-03-12 12:31:21 -07:00
2013-01-16 01:13:23 +00:00
2013-03-06 03:23:52 +00:00
2013-06-19 02:16:59 +01:00
2011-11-07 10:13:52 -08:00
2012-08-02 14:37:36 +01:00
2012-01-25 16:13:22 -08:00
2011-11-06 19:44:47 -08:00
2012-10-10 03:30:48 +01:00
2011-11-07 23:54:53 +01:00
2011-10-31 19:32:26 -04:00
2013-03-20 15:03:20 +00:00
2011-11-21 20:36:26 -08:00
2011-10-31 20:19:04 +00:00
2011-10-31 20:18:58 +00:00
2011-10-31 20:21:24 +00:00
2011-12-16 08:49:57 -08:00
2011-11-06 17:12:03 -08:00
2011-11-06 19:44:47 -08:00
2011-10-31 17:30:44 -07:00
2011-10-31 17:30:54 -07:00
2011-10-31 15:10:04 -02:00
2013-05-30 14:35:10 +01:00
2011-11-04 18:37:23 -04:00
2012-02-29 16:31:24 -08:00
2011-11-02 10:06:20 -07:00
2012-04-02 09:52:45 -07:00
2011-10-31 19:32:32 -04:00
2013-01-03 03:32:56 +00:00
2013-03-06 03:24:17 +00:00
2011-10-31 17:30:54 -07:00
2013-09-10 01:57:20 +01:00
2011-10-31 19:32:32 -04:00
2011-11-06 19:44:47 -08:00
2012-05-31 00:43:15 +01:00
2012-10-10 03:31:16 +01:00
2012-10-10 03:31:16 +01:00
2013-01-03 03:32:57 +00:00
2012-07-25 04:11:36 +01:00
2011-10-31 17:30:48 -07:00
2013-07-27 05:34:18 +01:00
2011-11-08 09:28:27 +02:00
2011-11-23 11:33:07 +01:00
2013-03-06 03:23:57 +00:00
2013-05-30 14:35:13 +01:00
2012-11-16 16:46:52 +00:00
2013-08-02 22:14:47 +02:00
2012-10-30 23:26:34 +00:00
2011-11-14 01:08:49 -05:00
2012-08-10 00:11:14 +01:00
2013-05-13 15:02:30 +01:00
2011-10-31 19:32:32 -04:00
2011-10-31 19:32:32 -04:00
2011-10-31 19:32:35 -04:00
2011-10-31 19:32:35 -04:00
2013-05-13 15:02:14 +01:00
2011-10-31 17:30:54 -07:00
2012-07-25 04:11:19 +01:00
2011-10-31 17:30:54 -07:00
2012-06-10 14:42:10 +01:00
2012-04-13 08:33:50 -07:00
2011-10-31 17:46:07 -07:00
2012-04-13 08:33:48 -07:00
2013-03-06 03:24:27 +00:00
2012-09-19 15:05:16 +01:00
2013-04-25 20:25:38 +01:00
2011-10-31 17:30:54 -07:00
2012-09-19 15:04:59 +01:00
2013-04-25 20:25:50 +01:00
2013-04-25 20:25:50 +01:00
2011-12-26 13:27:44 +02:00
2011-12-22 02:02:20 -05:00
2013-04-25 20:25:32 +01:00
2011-10-31 17:30:52 -07:00
2011-10-31 17:30:57 -07:00
2011-12-12 22:06:55 -08:00
2011-11-04 17:22:14 -07:00
2011-11-02 16:06:59 -07:00
2012-04-02 09:52:34 -07:00
2011-10-31 19:32:32 -04:00
2011-10-31 17:30:47 -07:00
2012-01-25 16:13:23 -08:00
2012-10-10 03:30:45 +01:00
2013-01-03 03:32:54 +00:00
2012-08-02 14:37:32 +01:00
2011-10-31 19:32:29 -04:00
2011-11-02 16:06:57 -07:00
2013-05-13 15:02:33 +01:00
2011-10-31 17:30:54 -07:00
2013-03-06 03:24:11 +00:00
2012-08-02 14:37:31 +01:00
2011-10-31 09:20:11 -04:00
2011-10-31 09:20:11 -04:00
2012-09-19 15:04:26 +01:00
2011-11-02 12:53:42 +01:00
2013-07-27 05:34:29 +01:00
2013-06-19 02:16:44 +01:00
2013-05-13 15:02:35 +01:00
2012-06-10 14:42:03 +01:00
2011-11-01 09:24:41 -07:00
2012-09-19 15:05:06 +01:00
2012-02-29 16:30:55 -08:00
2013-03-20 15:03:41 +00:00
2011-10-31 19:32:27 -04:00
2013-04-25 20:25:40 +01:00
2011-10-31 17:30:45 -07:00
2011-11-04 22:28:13 +01:00
2013-01-16 01:13:13 +00:00
2011-10-31 19:32:32 -04:00
2013-01-16 01:13:13 +00:00
2012-01-25 16:13:17 -08:00
2012-02-06 09:41:06 -08:00
2011-10-31 10:23:57 -07:00
2012-07-25 04:11:13 +01:00
2013-07-27 05:34:32 +01:00
2012-05-11 13:14:43 +01:00
2011-11-22 16:37:01 -05:00
2012-02-13 11:16:55 -08:00
2011-11-17 21:39:33 +01:00
2011-11-28 22:14:55 +01:00
2013-03-06 03:23:57 +00:00
2011-11-02 16:07:02 -07:00
2013-04-25 20:25:36 +01:00
2011-10-31 17:30:54 -07:00
2012-02-20 12:46:16 -08:00
2013-03-06 03:24:22 +00:00
2012-12-06 11:20:18 +00:00
2013-03-06 03:23:45 +00:00
2011-10-31 17:30:54 -07:00
2012-08-10 00:24:46 +01:00
2013-06-29 04:06:40 +01:00
2013-05-30 14:35:14 +01:00
2011-10-31 19:32:32 -04:00
2012-03-12 12:31:24 -07:00
2011-11-02 16:07:01 -07:00
2012-04-02 09:53:10 -07:00
2012-11-16 16:46:52 +00:00
2013-02-20 03:15:29 +00:00
2012-01-03 16:12:19 -08:00
2011-11-02 16:07:01 -07:00
2011-10-31 17:30:54 -07:00
2012-05-11 13:14:50 +01:00
2013-03-20 15:03:33 +00:00
2011-11-11 16:16:25 +09:00
2011-11-15 12:13:44 -08:00
2011-10-31 19:32:32 -04:00
2011-11-11 16:11:41 +09:00
2011-11-11 16:45:35 +09:00
2012-01-25 16:13:59 -08:00
2011-12-09 07:50:27 -08:00
2011-11-29 11:59:50 +00:00
2012-02-29 16:31:23 -08:00
2013-05-13 15:02:36 +01:00
2013-09-10 01:57:09 +01:00
2013-01-16 01:13:25 +00:00
2013-06-29 04:06:39 +01:00
2013-04-25 20:25:36 +01:00
2012-07-12 04:31:59 +01:00
2011-10-31 19:32:28 -04:00
2011-10-31 17:30:47 -07:00
2012-01-25 16:13:59 -08:00
2013-06-19 02:17:01 +01:00
2011-10-31 17:30:44 -07:00
2011-11-02 16:07:02 -07:00
2011-10-31 19:32:24 -04:00
2013-02-06 04:33:57 +00:00
2011-10-31 19:32:32 -04:00
2013-04-10 03:20:11 +01:00
2012-09-19 15:05:00 +01:00
2012-07-25 04:11:32 +01:00
2011-10-31 17:30:54 -07:00
2011-10-31 19:32:32 -04:00
2012-09-12 03:36:54 +01:00
2011-11-02 16:07:02 -07:00
2011-10-31 19:32:31 -04:00
2011-10-31 19:32:23 -04:00
2012-01-25 16:13:29 -08:00
2011-11-24 13:04:48 +10:30
2013-05-30 14:35:03 +01:00
2011-11-24 13:04:47 +10:30
2011-11-02 11:40:59 +10:30
2013-08-02 22:14:52 +02:00
2011-10-31 19:32:32 -04:00
2011-11-16 12:13:08 -05:00
2013-03-06 03:23:52 +00:00
2013-09-10 01:57:28 +01:00
2012-03-19 09:02:34 -07:00
2013-04-25 20:25:43 +01:00
2012-10-10 03:31:25 +01:00