block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group()
Carlo Nonato authored
[ Upstream commit 14afc593 ]

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 ...
4db2f87e
Name Last commit Last update
..
partitions docs: admin-guide: add a series of orphaned documents
Kconfig blkcg: implement blk-iocost
Kconfig.iosched docs: block: convert to ReST
Makefile blkcg: implement blk-iocost
badblocks.c block: switch all files cleared marked as GPLv2 to SPDX tags
bfq-cgroup.c block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group()
bfq-iosched.c block, bfq: remove ifdefs from around gets/puts of bfq groups
bfq-iosched.h block, bfq: remove ifdefs from around gets/puts of bfq groups
bfq-wf2q.c block, bfq: get a ref to a group when adding it to a service tree
bio-integrity.c block: fix memleak of bio integrity data
bio.c block: fix memleak of bio integrity data
blk-cgroup.c blkcg: make blkcg_print_stat() print stats only for online blkgs
blk-core.c block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT
blk-exec.c block: add SPDX tags to block layer files missing licensing information
blk-flush.c blk-mq: insert passthrough request into hctx->dispatch directly
blk-integrity.c block: centralize PI remapping logic to the block layer
blk-ioc.c block: remove the queue_lock indirection
blk-iocost.c blk-iocost: fix incorrect vtime comparison in iocg_is_idle()
blk-iolatency.c blkcg: s/RQ_QOS_CGROUP/RQ_QOS_LATENCY/
blk-lib.c block: fix 32 bit overflow in __blkdev_issue_discard()
blk-map.c block: fix memleak when __blk_rq_map_user_iov() is failed
blk-merge.c block: Improve physical block alignment of split bios
blk-mq-cpumap.c blk-mq: balance mapping between present CPUs and queues
blk-mq-debugfs-zoned.c block: Cleanup license notice
blk-mq-debugfs.c Merge tag 'for-5.3/block-20190708' of git://git.kernel.dk/linux-block
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c
blk-mq.h
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c
blk-softirq.c
blk-stat.c
blk-stat.h
blk-sysfs.c
blk-throttle.c
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c
blk.h
bounce.c
bsg-lib.c
bsg.c
cmdline-parser.c
compat_ioctl.c
elevator.c
genhd.c
ioctl.c
ioprio.c
kyber-iosched.c
mq-deadline.c
opal_proto.h
partition-generic.c
scsi_ioctl.c
sed-opal.c
t10-pi.c