WSL2-Linux-Kernel/block
Carlo Nonato 14afc59361 block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group()
The bfq_find_set_group() function takes as input a blkcg (which represents
a cgroup) and retrieves the corresponding bfq_group, then it updates the
bfq internal group hierarchy (see comments inside the function for why
this is needed) and finally it returns the bfq_group.
In the hierarchy update cycle, the pointer holding the correct bfq_group
that has to be returned is mistakenly used to traverse the hierarchy
bottom to top, meaning that in each iteration it gets overwritten with the
parent of the current group. Since the update cycle stops at root's
children (depth = 2), the overwrite becomes a problem only if the blkcg
describes a cgroup at a hierarchy level deeper than that (depth > 2). In
this case the root's child that happens to be also an ancestor of the
correct bfq_group is returned. The main consequence is that processes
contained in a cgroup at depth greater than 2 are wrongly placed in the
group described above by BFQ.

This commits fixes this problem by using a different bfq_group pointer in
the update cycle in order to avoid the overwrite of the variable holding
the original group reference.

Reported-by: Kwon Je Oh <kwonje.oh2@gmail.com>
Signed-off-by: Carlo Nonato <carlo.nonato95@gmail.com>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-06 07:00:58 -07:00
..
partitions partitions/ldm: fix spelling mistake "to" -> "too" 2020-01-23 11:41:45 -07:00
Kconfig block: Allow t10-pi to be modular 2020-01-06 20:59:04 -07:00
Kconfig.iosched blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT 2019-11-07 12:28:13 -07:00
Makefile SCSI misc on 20200129 2020-01-29 18:16:16 -08:00
badblocks.c
bfq-cgroup.c block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group() 2020-03-06 07:00:58 -07:00
bfq-iosched.c block, bfq: clarify the goal of bfq_split_bfqq() 2020-02-03 06:58:15 -07:00
bfq-iosched.h block, bfq: get a ref to a group when adding it to a service tree 2020-02-03 06:58:15 -07:00
bfq-wf2q.c block, bfq: get a ref to a group when adding it to a service tree 2020-02-03 06:58:15 -07:00
bio-integrity.c block: fix memleak of bio integrity data 2019-12-05 11:38:36 -07:00
bio.c fs: move guard_bio_eod() after bio_set_op_attrs 2020-01-09 08:16:12 -07:00
blk-cgroup-rwstat.c blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT 2019-11-07 12:28:13 -07:00
blk-cgroup-rwstat.h blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT 2019-11-07 12:28:13 -07:00
blk-cgroup.c blk-cgroup: remove blkcg_drain_queue 2019-12-12 09:26:55 -07:00
blk-core.c block: Remove used kblockd_schedule_work_on() 2020-03-02 07:17:31 -07:00
blk-exec.c
blk-flush.c blk-mq: insert passthrough request into hctx->dispatch directly 2020-02-24 18:50:48 -07:00
blk-integrity.c
blk-ioc.c
blk-iocost.c iocost: over-budget forced IOs should schedule async delay 2019-12-16 16:10:17 -07:00
blk-iolatency.c
blk-lib.c
blk-map.c block: fix memleak when __blk_rq_map_user_iov() is failed 2019-12-20 11:52:01 -07:00
blk-merge.c block: fix get_max_segment_size() overflow on 32bit arch 2020-01-14 13:37:40 -07:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: insert passthrough request into hctx->dispatch directly 2020-02-24 18:50:48 -07:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: make sure that line break can be printed 2019-11-04 07:14:10 -07:00
blk-mq-tag.c blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-mq-tag.h blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-mq-virtio.c
blk-mq.c blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-mq.h blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c block: fix an integer overflow in logical block size 2020-01-15 21:43:09 -07:00
blk-softirq.c block: Don't disable interrupts in trigger_softirq() 2019-11-18 07:29:22 -07:00
blk-stat.c
blk-stat.h
blk-sysfs.c
blk-throttle.c blk-cgroup: separate out blkg_rwstat under CONFIG_BLK_CGROUP_RWSTAT 2019-11-07 12:28:13 -07:00
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c block: mark zone-mgmt bios with REQ_SYNC 2020-01-09 07:59:12 -07:00
blk.h block: Fix a lockdep complaint triggered by request queue flushing 2019-12-20 11:52:01 -07:00
bounce.c
bsg-lib.c block: Fix the type of 'sts' in bsg_queue_rq() 2019-12-20 11:52:01 -07:00
bsg.c compat_ioctl: bsg: add handler 2020-01-03 09:33:21 +01:00
cmdline-parser.c
elevator.c Merge branch 'for-linus' into for-5.5/block 2019-11-07 12:27:19 -07:00
genhd.c block: add iostat counters for flush requests 2019-11-21 09:06:47 -07:00
ioctl.c compat_ioctl: simplify up block/ioctl.c 2020-01-03 09:42:52 +01:00
ioprio.c
kyber-iosched.c
mq-deadline.c
opal_proto.h block: sed-opal: Introduce SUM_SET_LIST parameter and append it using 'add_token_u64' 2019-11-18 09:49:15 -07:00
partition-generic.c block: allow partitions on host aware zone devices 2020-01-26 09:59:08 -07:00
scsi_ioctl.c compat_ioctl: move CDROM_SEND_PACKET handling into scsi 2020-01-03 09:33:05 +01:00
sed-opal.c block: sed-opal: Introduce SUM_SET_LIST parameter and append it using 'add_token_u64' 2019-11-18 09:49:15 -07:00
t10-pi.c block: Allow t10-pi to be modular 2020-01-06 20:59:04 -07:00