Skip to content

Commit

Permalink
updates for CFQ oops fix
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
Unknown authored and James Bottomley committed Apr 17, 2005
1 parent 152587d commit c2a9331
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions include/scsi/scsi_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c2a9331

Please sign in to comment.