Skip to content

Commit d16a63a

Browse files
JeffMoyergregkh
authored andcommitted
blk-flush: fix invalid BUG_ON in blk_insert_flush
commit 834f9f6 upstream. A user reported a regression due to commit 4853aba (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] http://www.redhat.com/archives/dm-devel/2011-September/msg00154.html Reported-by: Christophe Saout <christophe@saout.de> Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent e0aef70 commit d16a63a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎block/blk-flush.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void blk_insert_flush(struct request *rq)
320320
return;
321321
}
322322

323-
BUG_ON(!rq->bio || rq->bio != rq->biotail);
323+
BUG_ON(rq->bio != rq->biotail); /*assumes zero or single bio rq */
324324

325325
/*
326326
* If there's data but flush is not necessary, the request can be

0 commit comments

Comments
 (0)