diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-12 02:53:38 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-12 02:53:38 -0400 |
commit | bc47ab0241c7c86da4f5e5f82fbca7d45387c18d (patch) | |
tree | b9c33ae8b6de43e44cc5fcbaa3e4a15f18a5ed42 /block/bsg.c | |
parent | 37f9ef553bed630957e025504cdcbc76f5de49d5 (diff) | |
parent | 8ebf975608aaebd7feb33d77f07ba21a6380e086 (diff) |
Merge commit 'origin/master' into next
Manual merge of:
arch/powerpc/kernel/asm-offsets.c
Diffstat (limited to 'block/bsg.c')
-rw-r--r-- | block/bsg.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/block/bsg.c b/block/bsg.c index 206060e795da..5358f9ae13c1 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -315,6 +315,7 @@ out: | |||
315 | blk_put_request(rq); | 315 | blk_put_request(rq); |
316 | if (next_rq) { | 316 | if (next_rq) { |
317 | blk_rq_unmap_user(next_rq->bio); | 317 | blk_rq_unmap_user(next_rq->bio); |
318 | next_rq->bio = NULL; | ||
318 | blk_put_request(next_rq); | 319 | blk_put_request(next_rq); |
319 | } | 320 | } |
320 | return ERR_PTR(ret); | 321 | return ERR_PTR(ret); |
@@ -445,14 +446,15 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr, | |||
445 | } | 446 | } |
446 | 447 | ||
447 | if (rq->next_rq) { | 448 | if (rq->next_rq) { |
448 | hdr->dout_resid = rq->data_len; | 449 | hdr->dout_resid = rq->resid_len; |
449 | hdr->din_resid = rq->next_rq->data_len; | 450 | hdr->din_resid = rq->next_rq->resid_len; |
450 | blk_rq_unmap_user(bidi_bio); | 451 | blk_rq_unmap_user(bidi_bio); |
452 | rq->next_rq->bio = NULL; | ||
451 | blk_put_request(rq->next_rq); | 453 | blk_put_request(rq->next_rq); |
452 | } else if (rq_data_dir(rq) == READ) | 454 | } else if (rq_data_dir(rq) == READ) |
453 | hdr->din_resid = rq->data_len; | 455 | hdr->din_resid = rq->resid_len; |
454 | else | 456 | else |
455 | hdr->dout_resid = rq->data_len; | 457 | hdr->dout_resid = rq->resid_len; |
456 | 458 | ||
457 | /* | 459 | /* |
458 | * If the request generated a negative error number, return it | 460 | * If the request generated a negative error number, return it |
@@ -466,6 +468,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr, | |||
466 | blk_rq_unmap_user(bio); | 468 | blk_rq_unmap_user(bio); |
467 | if (rq->cmd != rq->__cmd) | 469 | if (rq->cmd != rq->__cmd) |
468 | kfree(rq->cmd); | 470 | kfree(rq->cmd); |
471 | rq->bio = NULL; | ||
469 | blk_put_request(rq); | 472 | blk_put_request(rq); |
470 | 473 | ||
471 | return ret; | 474 | return ret; |