summaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2017-07-14 23:50:00 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-15 00:05:13 +0200
commit168c42bc56d8d47f67f2a5206506cd4ba3c18475 (patch)
tree7e82690179b0b796505e493452f04c60df3613d9 /fs/proc/base.c
parentfault-inject: simplify access check for fail-nth (diff)
downloadlinux-168c42bc56d8d47f67f2a5206506cd4ba3c18475.tar.xz
linux-168c42bc56d8d47f67f2a5206506cd4ba3c18475.zip
fault-inject: add /proc/<pid>/fail-nth
fail-nth interface is only created in /proc/self/task/<current-tid>/. This change also adds it in /proc/<pid>/. This makes shell based tool a bit simpler. $ bash -c "builtin echo 100 > /proc/self/fail-nth && exec ls /" Link: http://lkml.kernel.org/r/1491490561-10485-6-git-send-email-akinobu.mita@gmail.com Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--fs/proc/base.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 872a3f28bfe4..719c2e943ea1 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2962,6 +2962,7 @@ static const struct pid_entry tgid_base_stuff[] = {
#endif
#ifdef CONFIG_FAULT_INJECTION
REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations),
+ REG("fail-nth", 0644, proc_fail_nth_operations),
#endif
#ifdef CONFIG_ELF_CORE
REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations),