]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq-debugfs: error on long write to queue "state" file
authorOmar Sandoval <osandov@fb.com>
Thu, 4 May 2017 07:31:25 +0000 (00:31 -0700)
committerJens Axboe <axboe@fb.com>
Thu, 4 May 2017 14:23:16 +0000 (08:23 -0600)
commitb4ebb3bafbfcf876cd0a8b07e8ec2210f951cd02
treedd19aadf9aeca8a7ea558c8de30e9f02e21e8aff
parent4fea406b4118d5d77d59f74271e7793a624c4a60
blk-mq-debugfs: error on long write to queue "state" file

blk_queue_flags_store() currently truncates and returns a short write if
the operation being written is too long. This can give us weird results,
like here:

$ echo "run            bar"
echo: write error: invalid argument
$ dmesg
[ 1103.075435] blk_queue_flags_store: unsupported operation bar. Use either 'run' or 'start'

Instead, return an error if the user does this. While we're here, make
the argument names consistent with everywhere else in this file.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-debugfs.c