summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/xen-scsifront.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2014-09-11 15:20:04 +0200
committerDavid Vrabel <david.vrabel@citrix.com>2014-10-03 13:34:40 +0200
commit7921a11c7b2929f3ed6fe9081edcf695c60b23c6 (patch)
tree6e3a63b89cd2cc9559a4b572390a7805ce305594 /drivers/scsi/xen-scsifront.c
parentx86: remove the Xen-specific _PAGE_IOMAP PTE flag (diff)
downloadlinux-7921a11c7b2929f3ed6fe9081edcf695c60b23c6.tar.xz
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/xen-scsifront.c')
-rw-r--r--drivers/scsi/xen-scsifront.c3
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)