Commit c1d4c41f2fdfe66dea957b76d005affba3e56b26

Authored by FUJITA Tomonori
Committed by Jens Axboe
1 parent 3af968e066

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>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -315,6 +315,7 @@
315 315 blk_put_request(rq);
316 316 if (next_rq) {
317 317 blk_rq_unmap_user(next_rq->bio);
  318 + next_rq->bio = NULL;
318 319 blk_put_request(next_rq);
319 320 }
320 321 return ERR_PTR(ret);
... ... @@ -448,6 +449,7 @@
448 449 hdr->dout_resid = rq->data_len;
449 450 hdr->din_resid = rq->next_rq->data_len;
450 451 blk_rq_unmap_user(bidi_bio);
  452 + rq->next_rq->bio = NULL;
451 453 blk_put_request(rq->next_rq);
452 454 } else if (rq_data_dir(rq) == READ)
453 455 hdr->din_resid = rq->data_len;
... ... @@ -466,6 +468,7 @@
466 468 blk_rq_unmap_user(bio);
467 469 if (rq->cmd != rq->__cmd)
468 470 kfree(rq->cmd);
  471 + rq->bio = NULL;
469 472 blk_put_request(rq);
470 473  
471 474 return ret;