diff options
authorJeff Moyer <>2011-10-17 12:57:22 +0200
committerJens Axboe <>2011-10-24 16:24:30 +0200
commit834f9f61a525d2f6d3d0c93894e26326c8d3ceed (patch)
parent456be1484ffc72a24bdb4200b5847c4fa90139d9 (diff)
blk-flush: fix invalid BUG_ON in blk_insert_flush
A user reported a regression due to commit 4853abaae7e4a2af938115ce9071ef8684fb7af4 (block: fix flush machinery for stacking drivers with differring flush flags). Part of the problem is that blk_insert_flush required a single bio be attached to the request. In reality, having no attached bio is also a valid case, as can be observed with an empty flush. [1] Reported-by: Christophe Saout <> Signed-off-by: Jeff Moyer < Acked-by: Tejun Heo <> Stable note: 3.1 Cc: Signed-off-by: Jens Axboe <>
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 491eb30a242d..89ae3b9bf7ca 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -320,7 +320,7 @@ void blk_insert_flush(struct request *rq)
- BUG_ON(!rq->bio || rq->bio != rq->biotail);
+ BUG_ON(rq->bio != rq->biotail); /*assumes zero or single bio rq */
* If there's data but flush is not necessary, the request can be