aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/ll_rw_blk.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index d875673e76cd..0fa5d3d556d9 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -377,10 +377,12 @@ void blk_ordered_complete_seq(struct request_queue *q, unsigned seq, int error)
377 /* 377 /*
378 * Okay, sequence complete. 378 * Okay, sequence complete.
379 */ 379 */
380 rq = q->orig_bar_rq; 380 uptodate = 1;
381 uptodate = q->orderr ? q->orderr : 1; 381 if (q->orderr)
382 uptodate = q->orderr;
382 383
383 q->ordseq = 0; 384 q->ordseq = 0;
385 rq = q->orig_bar_rq;
384 386
385 end_that_request_first(rq, uptodate, rq->hard_nr_sectors); 387 end_that_request_first(rq, uptodate, rq->hard_nr_sectors);
386 end_that_request_last(rq, uptodate); 388 end_that_request_last(rq, uptodate);
@@ -445,7 +447,8 @@ static inline struct request *start_ordered(struct request_queue *q,
445 rq_init(q, rq); 447 rq_init(q, rq);
446 if (bio_data_dir(q->orig_bar_rq->bio) == WRITE) 448 if (bio_data_dir(q->orig_bar_rq->bio) == WRITE)
447 rq->cmd_flags |= REQ_RW; 449 rq->cmd_flags |= REQ_RW;
448 rq->cmd_flags |= q->ordered & QUEUE_ORDERED_FUA ? REQ_FUA : 0; 450 if (q->ordered & QUEUE_ORDERED_FUA)
451 rq->cmd_flags |= REQ_FUA;
449 rq->elevator_private = NULL; 452 rq->elevator_private = NULL;
450 rq->elevator_private2 = NULL; 453 rq->elevator_private2 = NULL;
451 init_request_from_bio(rq, q->orig_bar_rq->bio); 454 init_request_from_bio(rq, q->orig_bar_rq->bio);
@@ -3191,7 +3194,7 @@ end_io:
3191 break; 3194 break;
3192 } 3195 }
3193 3196
3194 if (unlikely(bio_sectors(bio) > q->max_hw_sectors)) { 3197 if (unlikely(nr_sectors > q->max_hw_sectors)) {
3195 printk("bio too big device %s (%u > %u)\n", 3198 printk("bio too big device %s (%u > %u)\n",
3196 bdevname(bio->bi_bdev, b), 3199 bdevname(bio->bi_bdev, b),
3197 bio_sectors(bio), 3200 bio_sectors(bio),
@@ -3212,7 +3215,7 @@ end_io:
3212 blk_partition_remap(bio); 3215 blk_partition_remap(bio);
3213 3216
3214 if (old_sector != -1) 3217 if (old_sector != -1)
3215 blk_add_trace_remap(q, bio, old_dev, bio->bi_sector, 3218 blk_add_trace_remap(q, bio, old_dev, bio->bi_sector,
3216 old_sector); 3219 old_sector);
3217 3220
3218 blk_add_trace_bio(q, bio, BLK_TA_QUEUE); 3221 blk_add_trace_bio(q, bio, BLK_TA_QUEUE);
@@ -3564,7 +3567,7 @@ static struct notifier_block blk_cpu_notifier __cpuinitdata = {
3564 * Description: 3567 * Description:
3565 * Ends all I/O on a request. It does not handle partial completions, 3568 * Ends all I/O on a request. It does not handle partial completions,
3566 * unless the driver actually implements this in its completion callback 3569 * unless the driver actually implements this in its completion callback
3567 * through requeueing. Theh actual completion happens out-of-order, 3570 * through requeueing. The actual completion happens out-of-order,
3568 * through a softirq handler. The user must have registered a completion 3571 * through a softirq handler. The user must have registered a completion
3569 * callback through blk_queue_softirq_done(). 3572 * callback through blk_queue_softirq_done().
3570 **/ 3573 **/