Skip to content

Commit

Permalink
blk-flush: fix invalid BUG_ON in blk_insert_flush
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jeff Moyer <[email protected]
Acked-by: Tejun Heo <[email protected]>

Stable note: 3.1
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
JeffMoyer authored and axboe committed Oct 24, 2011
1 parent 456be14 commit 834f9f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void blk_insert_flush(struct request *rq)
return;
}

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
Expand Down

0 comments on commit 834f9f6

Please sign in to comment.