diff options
author | Tejun Heo <htejun@gmail.com> | 2005-05-13 11:46:08 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-05-20 13:53:54 -0400 |
commit | d8c37e7b9a619855e05d5d4e56c68f799b1f539c (patch) | |
tree | f32bcada38a55c16b8c0040043cd0ee087f48aec /drivers/scsi/scsi_lib.c | |
parent | 5b8ef8425898e957243053c26ac2b68bd4bc42ec (diff) |
[SCSI] remove a timer race in scsi_queue_insert()
scsi_queue_insert() has four callers. Three callers call with
timer disabled and one (the second invocation in
scsi_dispatch_cmd()) calls with timer activated.
scsi_queue_insert() used to always call scsi_delete_timer()
and ignore the return value. This results in race with timer
expiration. Remove scsi_delete_timer() call from
scsi_queue_insert() and make the caller delete timer and check
the return value.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index c3bb28c3feef..9f996499fa9d 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -128,13 +128,7 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) | |||
128 | printk("Inserting command %p into mlqueue\n", cmd)); | 128 | printk("Inserting command %p into mlqueue\n", cmd)); |
129 | 129 | ||
130 | /* | 130 | /* |
131 | * We are inserting the command into the ml queue. First, we | 131 | * Set the appropriate busy bit for the device/host. |
132 | * cancel the timer, so it doesn't time out. | ||
133 | */ | ||
134 | scsi_delete_timer(cmd); | ||
135 | |||
136 | /* | ||
137 | * Next, set the appropriate busy bit for the device/host. | ||
138 | * | 132 | * |
139 | * If the host/device isn't busy, assume that something actually | 133 | * If the host/device isn't busy, assume that something actually |
140 | * completed, and that we should be able to queue a command now. | 134 | * completed, and that we should be able to queue a command now. |