md/raid0: attach correct cgroup info in bio
authorShaohua Li <shli@fb.com>
Fri, 18 Aug 2017 17:27:59 +0000 (10:27 -0700)
committerShaohua Li <shli@fb.com>
Fri, 25 Aug 2017 17:21:48 +0000 (10:21 -0700)
The discard bio doesn't attach the original bio cgroup info. Normal bio
is cloned, so is fine.

Signed-off-by: Shaohua Li <shli@fb.com>
block/bio.c
drivers/md/raid0.c

index 9a63597aaaccd226dc03b9ab3595c693d5a918d7..51189a1d9009fdcfa36937c9b58b4097d54c94c2 100644 (file)
@@ -2085,7 +2085,7 @@ void bio_clone_blkcg_association(struct bio *dst, struct bio *src)
        if (src->bi_css)
                WARN_ON(bio_associate_blkcg(dst, src->bi_css));
 }
-
+EXPORT_SYMBOL_GPL(bio_clone_blkcg_association);
 #endif /* CONFIG_BLK_CGROUP */
 
 static void __init biovec_init_slabs(void)
index 94d9ae9b0fd09030daf663c5817d0b2566ea271d..6fb81704aff4f221138a8d70da311cc4626e6c67 100644 (file)
@@ -539,6 +539,7 @@ static void raid0_handle_discard(struct mddev *mddev, struct bio *bio)
                    !discard_bio)
                        continue;
                bio_chain(discard_bio, bio);
+               bio_clone_blkcg_association(discard_bio, bio);
                if (mddev->gendisk)
                        trace_block_bio_remap(bdev_get_queue(rdev->bdev),
                                discard_bio, disk_devt(mddev->gendisk),