diff options
author | Tejun Heo <tj@kernel.org> | 2010-09-03 05:56:17 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-10 06:35:37 -0400 |
commit | 09d60c701b64b509f328cac72970eb894f485b9e (patch) | |
tree | ef5d88b6fe6449395eeceb15988142c6297cefdc /block | |
parent | 47f70d5a6ca78c40a1c799d43506efbfed914f7b (diff) |
block: make sure FSEQ_DATA request has the same rq_disk as the original
rq->rq_disk and bio->bi_bdev->bd_disk may differ if a request has
passed through remapping drivers. FSEQ_DATA request incorrectly
followed bio->bi_bdev->bd_disk ending up being issued w/ mismatching
rq_disk. Make it follow orig_rq->rq_disk.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Tested-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-flush.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c index cb4c8440a1fc..7d1fc982e78f 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
@@ -111,6 +111,13 @@ static struct request *queue_next_fseq(struct request_queue *q) | |||
111 | break; | 111 | break; |
112 | case QUEUE_FSEQ_DATA: | 112 | case QUEUE_FSEQ_DATA: |
113 | init_request_from_bio(rq, orig_rq->bio); | 113 | init_request_from_bio(rq, orig_rq->bio); |
114 | /* | ||
115 | * orig_rq->rq_disk may be different from | ||
116 | * bio->bi_bdev->bd_disk if orig_rq got here through | ||
117 | * remapping drivers. Make sure rq->rq_disk points | ||
118 | * to the same one as orig_rq. | ||
119 | */ | ||
120 | rq->rq_disk = orig_rq->rq_disk; | ||
114 | rq->cmd_flags &= ~(REQ_FLUSH | REQ_FUA); | 121 | rq->cmd_flags &= ~(REQ_FLUSH | REQ_FUA); |
115 | rq->cmd_flags |= orig_rq->cmd_flags & (REQ_FLUSH | REQ_FUA); | 122 | rq->cmd_flags |= orig_rq->cmd_flags & (REQ_FLUSH | REQ_FUA); |
116 | rq->end_io = flush_data_end_io; | 123 | rq->end_io = flush_data_end_io; |