Skip to contentSkip to conversation

linux-2.6.18/scsifront: respect full ring on reset processing

PATCH New Jan Beulich 1 participant 1 message Nov 23, 2012 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.18/scsifront: respect full ring on reset processing

Additionally, the error return case of the wait_event_interruptible() at the end of scsifront_dev_reset_handler() wasn't handled, potentially causing shadow slot corruption.

Doing this also revealed that io_lock was pointless - it was only used inside the worker thread, i.e. protected nothing.

drivers/xen/scsifront/common.h +3 -3
@@ -99,7 +99,6 @@ struct vscsifrnt_info {
 
 	struct Scsi_Host *host;
 
-	spinlock_t io_lock;
 	spinlock_t shadow_lock;
 	unsigned int evtchn;
 	unsigned int irq;
@@ -113,8 +112,9 @@ struct vscsifrnt_info {
 
 	struct task_struct *kthread;
 	wait_queue_head_t wq;
-	unsigned int waiting_resp;
-
+	wait_queue_head_t wq_sync;
+	unsigned int waiting_resp:1;
+	unsigned int waiting_sync:1;
 };
 
 #define DPRINTK(_f, _a...)				\
drivers/xen/scsifront/scsifront.c +55 -15

123 lines not on this page · raw message

drivers/xen/scsifront/xenbus.c +1 -1
@@ -205,7 +205,7 @@ static int scsifront_probe(struct xenbus
 	}
 
 	init_waitqueue_head(&info->wq);
-	spin_lock_init(&info->io_lock);
+	init_waitqueue_head(&info->wq_sync);
 	spin_lock_init(&info->shadow_lock);
 
 	snprintf(name, DEFAULT_TASK_COMM_LEN, "vscsiif.%d", info->host->host_no);

scsifront: respect full ring on reset processing

Additionally, the error return case of the wait_event_interruptible() at the end of scsifront_dev_reset_handler() wasn't handled, potentially causing shadow slot corruption.

Doing this also revealed that io_lock was pointless - it was only used inside the worker thread, i.e. protected nothing.

drivers/xen/scsifront/common.h +3 -3
@@ -99,7 +99,6 @@ struct vscsifrnt_info {
 
 	struct Scsi_Host *host;
 
-	spinlock_t io_lock;
 	spinlock_t shadow_lock;
 	unsigned int evtchn;
 	unsigned int irq;
@@ -113,8 +112,9 @@ struct vscsifrnt_info {
 
 	struct task_struct *kthread;
 	wait_queue_head_t wq;
-	unsigned int waiting_resp;
-
+	wait_queue_head_t wq_sync;
+	unsigned int waiting_resp:1;
+	unsigned int waiting_sync:1;
 };
 
 #define DPRINTK(_f, _a...)				\
drivers/xen/scsifront/scsifront.c +55 -15

123 lines not on this page · raw message

drivers/xen/scsifront/xenbus.c +1 -1
@@ -205,7 +205,7 @@ static int scsifront_probe(struct xenbus
 	}
 
 	init_waitqueue_head(&info->wq);
-	spin_lock_init(&info->io_lock);
+	init_waitqueue_head(&info->wq_sync);
 	spin_lock_init(&info->shadow_lock);
 
 	snprintf(name, DEFAULT_TASK_COMM_LEN, "vscsiif.%d", info->host->host_no);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel