Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] dpt_i2o: fix waitqueue abuse

The driver plays with waitqueue internals and fails to compile after Ben's
"aio: make wait_queue ->task ->private" patch.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andrew Morton and committed by
Linus Torvalds
4452ea50 152becd2

+5 -12
+5 -12
drivers/scsi/dpt_i2o.c
··· 1126 1126 struct adpt_i2o_post_wait_data *p1, *p2; 1127 1127 struct adpt_i2o_post_wait_data *wait_data = 1128 1128 kmalloc(sizeof(struct adpt_i2o_post_wait_data),GFP_KERNEL); 1129 - adpt_wait_queue_t wait; 1129 + DECLARE_WAITQUEUE(wait, current); 1130 1130 1131 - if(!wait_data){ 1131 + if (!wait_data) 1132 1132 return -ENOMEM; 1133 - } 1133 + 1134 1134 /* 1135 1135 * The spin locking is needed to keep anyone from playing 1136 1136 * with the queue pointers and id while we do the same ··· 1148 1148 wait_data->wq = &adpt_wq_i2o_post; 1149 1149 wait_data->status = -ETIMEDOUT; 1150 1150 1151 - // this code is taken from kernel/sched.c:interruptible_sleep_on_timeout 1152 - wait.task = current; 1153 - init_waitqueue_entry(&wait, current); 1154 - spin_lock_irqsave(&adpt_wq_i2o_post.lock, flags); 1155 - __add_wait_queue(&adpt_wq_i2o_post, &wait); 1156 - spin_unlock(&adpt_wq_i2o_post.lock); 1151 + add_wait_queue(&adpt_wq_i2o_post, &wait); 1157 1152 1158 1153 msg[2] |= 0x80000000 | ((u32)wait_data->id); 1159 1154 timeout *= HZ; ··· 1170 1175 if(pHba->host) 1171 1176 spin_lock_irq(pHba->host->host_lock); 1172 1177 } 1173 - spin_lock_irq(&adpt_wq_i2o_post.lock); 1174 - __remove_wait_queue(&adpt_wq_i2o_post, &wait); 1175 - spin_unlock_irqrestore(&adpt_wq_i2o_post.lock, flags); 1178 + remove_wait_queue(&adpt_wq_i2o_post, &wait); 1176 1179 1177 1180 if(status == -ETIMEDOUT){ 1178 1181 printk(KERN_INFO"dpti%d: POST WAIT TIMEOUT\n",pHba->unit);