blk-flush: fix invalid BUG_ON in blk_insert_flush
authorJeff Moyer <jmoyer@redhat.com>
Mon, 17 Oct 2011 10:57:22 +0000 (12:57 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 24 Oct 2011 14:24:30 +0000 (16:24 +0200)
commit834f9f61a525d2f6d3d0c93894e26326c8d3ceed
tree73e973ad0c01ce4ac0317f089c9cbb3707186834
parent456be1484ffc72a24bdb4200b5847c4fa90139d9
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] 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>

Stable note: 3.1
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-flush.c