diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-25 11:57:52 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-25 12:04:08 -0400 |
commit | 401a18e92ce32cd0ddfa5738899ca2b8114f2bbf (patch) | |
tree | f8c7dbb61a7a90ae43065075b640512899fafd28 /block | |
parent | 6c5103890057b1bb781b26b7aae38d33e4c517d8 (diff) |
block: fix bug with inserting flush requests as sort/merge
With the introduction of the on-stack plugging, we would assume
that any request being inserted was a normal file system request.
As flush/fua requires a special insert mode, this caused problems.
Fix this up by checking for this in flush_plug_list() and use
the appropriate insert mechanism.
Big thanks goes to Markus Tripplesdorf for tirelessly testing
patches, and to Sergey Senozhatsky for helping find the real
issue.
Reported-by: Markus Tripplesdorf <markus@trippelsdorf.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 59b5c00c0126..64e96ee1d6af 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2702,7 +2702,10 @@ static void flush_plug_list(struct blk_plug *plug) | |||
2702 | /* | 2702 | /* |
2703 | * rq is already accounted, so use raw insert | 2703 | * rq is already accounted, so use raw insert |
2704 | */ | 2704 | */ |
2705 | __elv_add_request(q, rq, ELEVATOR_INSERT_SORT_MERGE); | 2705 | if (rq->cmd_flags & (REQ_FLUSH | REQ_FUA)) |
2706 | __elv_add_request(q, rq, ELEVATOR_INSERT_FLUSH); | ||
2707 | else | ||
2708 | __elv_add_request(q, rq, ELEVATOR_INSERT_SORT_MERGE); | ||
2706 | } | 2709 | } |
2707 | 2710 | ||
2708 | if (q) { | 2711 | if (q) { |