提交 ecaad81c 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

fault-inject: automatically detect the number base for fail-nth write interface

Automatically detect the number base to use when writing to fail-nth
file instead of always parsing as a decimal number.

Link: http://lkml.kernel.org/r/1491490561-10485-2-git-send-email-akinobu.mita@gmail.comSigned-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5f92a7b0
...@@ -1368,7 +1368,7 @@ static ssize_t proc_fail_nth_write(struct file *file, const char __user *buf, ...@@ -1368,7 +1368,7 @@ static ssize_t proc_fail_nth_write(struct file *file, const char __user *buf,
put_task_struct(task); put_task_struct(task);
if (task != current) if (task != current)
return -EPERM; return -EPERM;
err = kstrtoint_from_user(buf, count, 10, &n); err = kstrtoint_from_user(buf, count, 0, &n);
if (err) if (err)
return err; return err;
if (n < 0 || n == INT_MAX) if (n < 0 || n == INT_MAX)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册