updates for CFQ oops fix
author <jejb@titanic.il.steeleye.com> <>
Tue, 12 Apr 2005 21:38:09 +0000 (16:38 -0500)
committerJames Bottomley <jejb@titanic>
Sun, 17 Apr 2005 01:10:34 +0000 (20:10 -0500)
- add a comment to the device structure that the device_busy field
  is now protected by the request_queue->queue_lock
- null out sdev->request_queue after the queue is released to trap
  any (and there shouldn't be any) use after the queue is freed.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_sysfs.c
include/scsi/scsi_device.h

index 134d3a3..e75ee46 100644 (file)
@@ -171,6 +171,9 @@ void scsi_device_dev_release(struct device *dev)
        if (sdev->request_queue) {
                sdev->request_queue->queuedata = NULL;
                scsi_free_queue(sdev->request_queue);
+               /* temporary expedient, try to catch use of queue lock
+                * after free of sdev */
+               sdev->request_queue = NULL;
        }
 
        scsi_target_reap(scsi_target(sdev));
index f6d0513..fe9571d 100644 (file)
@@ -43,6 +43,7 @@ struct scsi_device {
        struct list_head    siblings;   /* list of all devices on this host */
        struct list_head    same_target_siblings; /* just the devices sharing same target id */
 
+       /* this is now protected by the request_queue->queue_lock */
        volatile unsigned short device_busy;    /* commands actually active on low-level */
        spinlock_t list_lock;
        struct list_head cmd_list;      /* queue of in use SCSI Command structures */