]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - block/scsi_ioctl.c
block: drop unnecessary blk_get/put_queue() in scsi_cmd_ioctl() and blk_get_tg()
authorTejun Heo <tj@kernel.org>
Wed, 19 Oct 2011 12:31:25 +0000 (14:31 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 19 Oct 2011 12:31:25 +0000 (14:31 +0200)
commit315fceee81155ef2aeed9316ca72aeea9347db5c
tree91ac02284b6737e6b65e855da771f52dbb3ad32d
parent75eb6c372d41d6d140b893873f6687d78c987a44
block: drop unnecessary blk_get/put_queue() in scsi_cmd_ioctl() and blk_get_tg()

blk_get/put_queue() in scsi_cmd_ioctl() and throtl_get_tg() are
completely bogus.  The caller must have a reference to the queue on
entry and taking an extra reference doesn't change anything.

For scsi_cmd_ioctl(), the only effect is that it ends up checking
QUEUE_FLAG_DEAD on entry; however, this is bogus as queue can die
right after blk_get_queue().  Dead queue should be and is handled in
request issue path (it's somewhat broken now but that's a separate
problem and doesn't affect this one much).

throtl_get_tg() incorrectly assumes that q is rcu freed.  Also, it
doesn't check return value of blk_get_queue().  If the queue is
already dead, it ends up doing an extra put.

Drop them.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-throttle.c
block/scsi_ioctl.c