diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2009-03-02 15:09:11 +0300 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-12 20:58:22 +0300 |
commit | 6d1a27f630f1d30bf85c61ec0436c287d0945fcc (patch) | |
tree | 0ad5c2acce91c95ed1a2d12ca58f9f2dac279266 /drivers/s390/scsi/zfcp_fc.c | |
parent | 947a9aca86eb2a921ed7aa92397cf7f38b896f90 (diff) | |
download | linux-6d1a27f630f1d30bf85c61ec0436c287d0945fcc.tar.xz |
[SCSI] zfcp: Ensure all work is cancelled on adapter dequeue
A scheduled work might still be pending, running while the adapter is
in progress to get dequeued from the system. This can lead to an
invalid pointer dereference (Oops). Once the adpater is set online
again, ensure the nameserver environment is initialized to the
appropriate values again.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fc.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index c22c47868550..aab8123c5966 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -98,8 +98,12 @@ static void zfcp_wka_port_offline(struct work_struct *work) struct zfcp_wka_port *wka_port = container_of(dw, struct zfcp_wka_port, work); - wait_event(wka_port->completion_wq, - atomic_read(&wka_port->refcount) == 0); + /* Don't wait forvever. If the wka_port is too busy take it offline + through a new call later */ + if (!wait_event_timeout(wka_port->completion_wq, + atomic_read(&wka_port->refcount) == 0, + HZ >> 1)) + return; mutex_lock(&wka_port->mutex); if ((atomic_read(&wka_port->refcount) != 0) || |