]> git.baikalelectronics.ru Git - kernel.git/commit
blk-cgroup: be able to remove the record of unplugged device
authorWanlong Gao <gaowanlong@cn.fujitsu.com>
Wed, 21 Sep 2011 08:22:10 +0000 (10:22 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Sep 2011 08:22:10 +0000 (10:22 +0200)
commitd30b3cc299dcc5f4aaa2607e49db03fbfe67a5d2
tree248949fdd3c8894db0e161e9338a3a984c1ce0f7
parente199748abe02086020a08a054eb02c992ecdc50b
blk-cgroup: be able to remove the record of unplugged device

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: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c