diff options
author | David Vrabel <david.vrabel@citrix.com> | 2014-09-11 14:20:04 +0100 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2014-10-03 12:34:40 +0100 |
commit | 7921a11c7b2929f3ed6fe9081edcf695c60b23c6 (patch) | |
tree | 6e3a63b89cd2cc9559a4b572390a7805ce305594 /drivers/scsi | |
parent | f955371ca9d3986bca100666041fcfa9b6d21962 (diff) | |
download | linux-7921a11c7b2929f3ed6fe9081edcf695c60b23c6.tar.gz linux-7921a11c7b2929f3ed6fe9081edcf695c60b23c6.tar.bz2 linux-7921a11c7b2929f3ed6fe9081edcf695c60b23c6.zip |
xen-scsifront: don't deadlock if the ring becomes full
scsifront_action_handler() will deadlock on host->host_lock, if the
ring is full and it has to wait for entries to become available.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/xen-scsifront.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index 7e88659bf5af..cc14c8ddd369 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -541,8 +541,9 @@ static int scsifront_action_handler(struct scsi_cmnd *sc, uint8_t act) if (!shadow) return FAILED; + spin_lock_irq(host->host_lock); + for (;;) { - spin_lock_irq(host->host_lock); if (!RING_FULL(&info->ring)) { ring_req = scsifront_command2ring(info, sc, shadow); if (ring_req) |