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)
commitc7e4145ae11b45931f117aa64c26be6cf58302df
treedd19aadf9aeca8a7ea558c8de30e9f02e21e8aff
parent1a435111f8eb30b370e3891caebb1d1ca61f41ec
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