aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/as-iosched.c3
-rw-r--r--block/blk-map.c8
2 files changed, 3 insertions, 8 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c
index 9735acb5b4f5..cf4eb0eefbbf 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -837,8 +837,7 @@ static void as_completed_request(struct request_queue *q, struct request *rq)
837 WARN_ON(!list_empty(&rq->queuelist)); 837 WARN_ON(!list_empty(&rq->queuelist));
838 838
839 if (RQ_STATE(rq) != AS_RQ_REMOVED) { 839 if (RQ_STATE(rq) != AS_RQ_REMOVED) {
840 printk("rq->state %d\n", RQ_STATE(rq)); 840 WARN(1, "rq->state %d\n", RQ_STATE(rq));
841 WARN_ON(1);
842 goto out; 841 goto out;
843 } 842 }
844 843
diff --git a/block/blk-map.c b/block/blk-map.c
index ddd96fb11a7d..af37e4ae62f5 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -269,7 +269,6 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
269 int reading = rq_data_dir(rq) == READ; 269 int reading = rq_data_dir(rq) == READ;
270 int do_copy = 0; 270 int do_copy = 0;
271 struct bio *bio; 271 struct bio *bio;
272 unsigned long stack_mask = ~(THREAD_SIZE - 1);
273 272
274 if (len > (q->max_hw_sectors << 9)) 273 if (len > (q->max_hw_sectors << 9))
275 return -EINVAL; 274 return -EINVAL;
@@ -278,11 +277,8 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
278 277
279 kaddr = (unsigned long)kbuf; 278 kaddr = (unsigned long)kbuf;
280 alignment = queue_dma_alignment(q) | q->dma_pad_mask; 279 alignment = queue_dma_alignment(q) | q->dma_pad_mask;
281 do_copy = ((kaddr & alignment) || (len & alignment)); 280 do_copy = ((kaddr & alignment) || (len & alignment) ||
282 281 object_is_on_stack(kbuf));
283 if (!((kaddr & stack_mask) ^
284 ((unsigned long)current->stack & stack_mask)))
285 do_copy = 1;
286 282
287 if (do_copy) 283 if (do_copy)
288 bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading); 284 bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading);