Steven Rostedt (VMware) 757d914007 tracing/blktrace: Fix to allow setting same value
Masami Hiramatsu reported:

  Current trace-enable attribute in sysfs returns an error
  if user writes the same setting value as current one,
  e.g.

    # cat /sys/block/sda/trace/enable
    0
    # echo 0 > /sys/block/sda/trace/enable
    bash: echo: write error: Invalid argument
    # echo 1 > /sys/block/sda/trace/enable
    # echo 1 > /sys/block/sda/trace/enable
    bash: echo: write error: Device or resource busy

  But this is not a preferred behavior, it should ignore
  if new setting is same as current one. This fixes the
  problem as below.

    # cat /sys/block/sda/trace/enable
    0
    # echo 0 > /sys/block/sda/trace/enable
    # echo 1 > /sys/block/sda/trace/enable
    # echo 1 > /sys/block/sda/trace/enable

Link: http://lkml.kernel.org/r/20180816103802.08678002@gandalf.local.home

Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Cc: stable@vger.kernel.org
Fixes: cd649b8bb830d ("blktrace: remove sysfs_blk_trace_enable_show/store()")
Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-08-16 14:13:56 -06:00
..
2018-06-15 18:10:01 -03:00
2018-06-12 16:19:22 -07:00
2018-06-28 14:00:40 +02:00
2018-06-06 16:04:55 -07:00
\n
2018-06-17 05:06:18 +09:00
2018-03-15 20:34:40 +01:00
2018-04-27 14:34:51 +02:00
2018-08-05 19:32:09 -06:00
2018-06-16 07:36:39 +09:00
2018-06-08 17:21:52 -07:00
2018-06-06 16:34:00 -07:00
2018-06-12 16:19:22 -07:00
2018-06-07 16:56:28 -04:00
2018-06-12 16:19:22 -07:00