aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-06-09 09:17:37 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-06-09 09:17:37 -0400
commitc1d4c41f2fdfe66dea957b76d005affba3e56b26 (patch)
tree9436a0f4417c1f938103a55c739c6c6e1fdbf94b /block
parent3af968e066d593bc4dacc021715f3e95ddf0996f (diff)
bsg: setting rq->bio to NULL
Due to commit 1cd96c242a829d52f7a5ae98f554ca9775429685 ("block: WARN in __blk_put_request() for potential bio leak"), BSG SMP requests get the false warnings: WARNING: at block/blk-core.c:1068 __blk_put_request+0x52/0xc0() This sets rq->bio to NULL to avoid that false warnings. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 206060e795da..dd81be455e00 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);
@@ -448,6 +449,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
448 hdr->dout_resid = rq->data_len; 449 hdr->dout_resid = rq->data_len;
449 hdr->din_resid = rq->next_rq->data_len; 450 hdr->din_resid = rq->next_rq->data_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->data_len;
@@ -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;