User: | Jiri Slaby |
Error type: | Double Lock |
Error type description: | Some lock is locked twice unintentionally in a sequence |
File location: | block/blk-core.c |
Line in file: | 1241 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
Smatch (1.59) |
Entered: | 2012-02-27 21:22:42 UTC |
1211 1212 /* ELV_NO_MERGE: elevator says don't/can't merge. */ 1213 default: 1214 ; 1215 } 1216 1217get_rq: 1218 /* 1219 * This sync check and mask will be re-done in init_request_from_bio(), 1220 * but we need to set it earlier to expose the sync flag to the 1221 * rq allocator and io schedulers. 1222 */ 1223 rw_flags = bio_data_dir(bio); 1224 if (sync) 1225 rw_flags |= REQ_RW_SYNC; 1226 1227 /* 1228 * Grab a free request. This is might sleep but can not fail. 1229 * Returns with the queue unlocked. 1230 */ 1231 req = get_request_wait(q, rw_flags, bio); 1232 1233 /* 1234 * After dropping the lock and possibly sleeping here, our request 1235 * may now be mergeable after it had proven unmergeable (above). 1236 * We don't worry about that case for efficiency. It won't happen 1237 * often, and the elevators are able to handle it. 1238 */ 1239 init_request_from_bio(req, bio); 1240 1241 spin_lock_irq(q->queue_lock); 1242 if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) || 1243 bio_flagged(bio, BIO_CPU_AFFINE)) 1244 req->cpu = blk_cpu_to_group(smp_processor_id()); 1245 if (elv_queue_empty(q)) 1246 blk_plug_device(q); 1247 add_request(q, req); 1248out: 1249 if (sync) 1250 __generic_unplug_device(q); 1251 spin_unlock_irq(q->queue_lock);