]> 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)
commit6236c71622778b395dcfab33ac79b095ada49bab
treedd19aadf9aeca8a7ea558c8de30e9f02e21e8aff
parente3a087e037c6e546386e80544d9c720528a2cffa
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