diff options
| author | Dennis Zhou <dennis@kernel.org> | 2018-10-20 14:56:12 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2018-10-20 17:39:55 -0400 |
| commit | d459d853c2edc793135e4bfa4e345c758f1cc859 (patch) | |
| tree | bef29425e5ddb78a788cca764e926b4f5601f473 /include/linux | |
| parent | b2c3fa546705944e748666b474ffdaebaec0569f (diff) | |
blkcg: reassociate bios when make_request() is called recursively
When submitting a bio, multiple recursive calls to make_request() may
occur. This causes the initial associate done in blkcg_bio_issue_check()
to be incorrect and reference the prior request_queue. This introduces
a helper to do reassociation when make_request() is recursively called.
Fixes: a7b39b4e961c ("blkcg: always associate a bio with a blkg")
Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bio.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index f447b0ebb288..b47c7f716731 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -514,6 +514,7 @@ int bio_associate_blkg(struct bio *bio, struct blkcg_gq *blkg); | |||
| 514 | int bio_associate_blkg_from_css(struct bio *bio, | 514 | int bio_associate_blkg_from_css(struct bio *bio, |
| 515 | struct cgroup_subsys_state *css); | 515 | struct cgroup_subsys_state *css); |
| 516 | int bio_associate_create_blkg(struct request_queue *q, struct bio *bio); | 516 | int bio_associate_create_blkg(struct request_queue *q, struct bio *bio); |
| 517 | int bio_reassociate_blkg(struct request_queue *q, struct bio *bio); | ||
| 517 | void bio_disassociate_task(struct bio *bio); | 518 | void bio_disassociate_task(struct bio *bio); |
| 518 | void bio_clone_blkg_association(struct bio *dst, struct bio *src); | 519 | void bio_clone_blkg_association(struct bio *dst, struct bio *src); |
| 519 | #else /* CONFIG_BLK_CGROUP */ | 520 | #else /* CONFIG_BLK_CGROUP */ |
| @@ -522,6 +523,8 @@ static inline int bio_associate_blkg_from_css(struct bio *bio, | |||
| 522 | { return 0; } | 523 | { return 0; } |
| 523 | static inline int bio_associate_create_blkg(struct request_queue *q, | 524 | static inline int bio_associate_create_blkg(struct request_queue *q, |
| 524 | struct bio *bio) { return 0; } | 525 | struct bio *bio) { return 0; } |
| 526 | static inline int bio_reassociate_blkg(struct request_queue *q, struct bio *bio) | ||
| 527 | { return 0; } | ||
| 525 | static inline void bio_disassociate_task(struct bio *bio) { } | 528 | static inline void bio_disassociate_task(struct bio *bio) { } |
| 526 | static inline void bio_clone_blkg_association(struct bio *dst, | 529 | static inline void bio_clone_blkg_association(struct bio *dst, |
| 527 | struct bio *src) { } | 530 | struct bio *src) { } |
