blk-cgroup: be able to remove the record of unplugged device
Wanlong Gao authored

The bug is we're not able to remove the device from blkio cgroup's
per-device control files if it gets unplugged.

To reproduce the bug:

  # mount -t cgroup -o blkio xxx /cgroup
  # cd /cgroup
  # echo "8:0 1000" > blkio.throttle.read_bps_device
  # unplug the device
  # cat blkio.throttle.read_bps_device
  8:0	1000
  # echo "8:0 0" > blkio.throttle.read_bps_device
  -bash: echo: write error: No such device

After patching, the device removal will succeed.

Thanks for the comments of Paul, Zefan, and Vivek.
Signed-off-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
d11bb446
Name Last commit Last update
..
Kconfig block: add bsg helper library
Kconfig.iosched blk-cgroup: config options re-arrangement
Makefile block: add bsg helper library
blk-cgroup.c blk-cgroup: be able to remove the record of unplugged device
blk-cgroup.h cfq-iosched: Make IO merge related stats per cpu
blk-core.c block: simplify force plug flush code a little bit
blk-exec.c [SCSI] fix crash in scsi_dispatch_cmd()
blk-flush.c block: fix flush machinery for stacking drivers with differring flush flags
blk-integrity.c dm: improve block integrity support
blk-ioc.c Merge branch 'for-linus' into for-3.1/core
blk-iopoll.c tree-wide: fix assorted typos all over the place
blk-lib.c block: fix patch import error in max_discard_sectors check
blk-map.c block: check for proper length of iov entries earlier in blk_rq_map_user_iov()
blk-merge.c block: attempt to merge with existing requests on plug flush
blk-settings.c block: Fix discard topology stacking and reporting
blk-softirq.c block: Don't check QUEUE_FLAG_SAME_COMP in __blk_complete_request
blk-sysfs.c block: Fix queue_flag update when rq_affinity goes from 2 to 1
blk-tag.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
blk-throttle.c blk-throttle: correctly determine sync bio
blk-timeout.c fault-injection: add ability to export fault_attr in arbitrary directory
blk.h block: fix flush machinery for stacking drivers with differring flush flags
bsg-lib.c bsg-lib: add module.h include
bsg.c bsg: fix address space warning from sparse
cfq-iosched.c block: separate priority boosting from REQ_META
cfq.h blk-cgroup: Add unaccounted time to timeslice_used.
compat_ioctl.c
deadline-iosched.c
elevator.c
genhd.c
ioctl.c
noop-iosched.c
scsi_ioctl.c