public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "block: WARN in __blk_put_request() for potential bio leak"
@ 2009-06-09 10:44 FUJITA Tomonori
  2009-06-09 11:53 ` Boaz Harrosh
  0 siblings, 1 reply; 16+ messages in thread
From: FUJITA Tomonori @ 2009-06-09 10:44 UTC (permalink / raw)
  To: jens.axboe; +Cc: linux-scsi, James.Bottomley, bharrosh

This reverts commit 1cd96c242a829d52f7a5ae98f554ca9775429685.

commit 1cd96c242a829d52f7a5ae98f554ca9775429685
Author: Boaz Harrosh <bharrosh@panasas.com>
Date:   Tue Mar 24 12:35:07 2009 +0100

    block: WARN in __blk_put_request() for potential bio leak

    Put a WARN_ON in __blk_put_request if it is about to
    leak bio(s). This is a serious bug that can happen in error
    handling code paths.

    For this to work I have fixed a couple of places in block/ where
    request->bio != NULL ownership was not honored. And a small cleanup
    at sg_io() while at it.


With 2.6.30-rc, BSG SMP requests get the following warnings:

WARNING: at block/blk-core.c:1068 __blk_put_request+0x52/0xc0()

However, this is false. There is no bio leak wrt BSG SMP
requests. Probably the better fix is calling blk_end_request_all() in
the BSG SMP path.

blk_end_request_all() is not very useful for the BSG SMP path (we call
it to just unlink rq->bio) however calling blk_end_request_all() in
all bio users is consistent.

blk_end_request_all() is not available in 2.6.30-rc so seems that the
simplest fix is removing WARN_ON for now.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 block/blk-core.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index c89883b..4aacb3c 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1064,9 +1064,6 @@ void __blk_put_request(struct request_queue *q, struct request *req)
 
 	elv_completed_request(q, req);
 
-	/* this is a bio leak */
-	WARN_ON(req->bio != NULL);
-
 	/*
 	 * Request may not have originated from ll_rw_blk. if not,
 	 * it didn't come out of our reserved rq pools
-- 
1.6.0.6



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-06-11 10:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-09 10:44 [PATCH] Revert "block: WARN in __blk_put_request() for potential bio leak" FUJITA Tomonori
2009-06-09 11:53 ` Boaz Harrosh
2009-06-09 13:10   ` FUJITA Tomonori
2009-06-09 13:18     ` Jens Axboe
2009-06-09 13:32     ` Boaz Harrosh
2009-06-09 23:00       ` FUJITA Tomonori
2009-06-10  8:15         ` Boaz Harrosh
2009-06-10  8:29           ` FUJITA Tomonori
2009-06-10  8:34             ` Boaz Harrosh
2009-06-11 10:10               ` FUJITA Tomonori
2009-06-10  8:45             ` Boaz Harrosh
2009-06-10  8:52               ` FUJITA Tomonori
2009-06-10  9:21                 ` Boaz Harrosh
2009-06-10  9:36                   ` FUJITA Tomonori
2009-06-10  9:48                     ` Boaz Harrosh
2009-06-10 10:01                       ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox