From 152587deb8903c0edf483a5b889f975bc6bea7e0 Mon Sep 17 00:00:00 2001 From: Date: Tue, 12 Apr 2005 16:22:06 -0500 Subject: [PATCH] fix NMI lockup with CFQ scheduler The current problem seen is that the queue lock is actually in the SCSI device structure, so when that structure is freed on device release, we go boom if the queue tries to access the lock again. The fix here is to move the lock from the scsi_device to the queue. Signed-off-by: James Bottomley --- include/linux/blkdev.h | 5 ++++- include/scsi/scsi_device.h | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 70ac2860a605..ef1afc178c0a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -355,8 +355,11 @@ struct request_queue unsigned long queue_flags; /* - * protects queue structures from reentrancy + * protects queue structures from reentrancy. ->__queue_lock should + * _never_ be used directly, it is queue private. always use + * ->queue_lock. */ + spinlock_t __queue_lock; spinlock_t *queue_lock; /* diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 07d974051b0c..f6d051318299 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -44,7 +44,6 @@ struct scsi_device { struct list_head same_target_siblings; /* just the devices sharing same target id */ volatile unsigned short device_busy; /* commands actually active on low-level */ - spinlock_t sdev_lock; /* also the request queue_lock */ spinlock_t list_lock; struct list_head cmd_list; /* queue of in use SCSI Command structures */ struct list_head starved_entry; -- cgit v1.2.3-59-g8ed1b