Commit d92c370a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: really clone the block cgroup in bio_clone_blkg_association

bio_clone_blkg_association is supposed to clone the associatation, but
actually ends up doing a search with a tryget.  As we know we have a
reference on the source cgroup just get an unconditional additional
reference to it and call it a day.  That also removes the need for
a RCU critical section.
Acked-by: default avatarTejun Heo <tj@kernel.org>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent db9819c7
...@@ -1737,12 +1737,12 @@ EXPORT_SYMBOL_GPL(bio_associate_blkg); ...@@ -1737,12 +1737,12 @@ EXPORT_SYMBOL_GPL(bio_associate_blkg);
*/ */
void bio_clone_blkg_association(struct bio *dst, struct bio *src) void bio_clone_blkg_association(struct bio *dst, struct bio *src)
{ {
rcu_read_lock(); if (src->bi_blkg) {
if (dst->bi_blkg)
if (src->bi_blkg) blkg_put(dst->bi_blkg);
__bio_associate_blkg(dst, src->bi_blkg); blkg_get(src->bi_blkg);
dst->bi_blkg = src->bi_blkg;
rcu_read_unlock(); }
} }
EXPORT_SYMBOL_GPL(bio_clone_blkg_association); EXPORT_SYMBOL_GPL(bio_clone_blkg_association);
#endif /* CONFIG_BLK_CGROUP */ #endif /* CONFIG_BLK_CGROUP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment