diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2017-07-14 17:50:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-14 18:05:13 -0400 |
commit | 168c42bc56d8d47f67f2a5206506cd4ba3c18475 (patch) | |
tree | 7e82690179b0b796505e493452f04c60df3613d9 | |
parent | 1203c8e6fb0aa1e9c39d2323607a74c3adc34fd8 (diff) |
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>
-rw-r--r-- | Documentation/fault-injection/fault-injection.txt | 3 | ||||
-rw-r--r-- | fs/proc/base.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt index 370ddcbc2b44..918972babcd8 100644 --- a/Documentation/fault-injection/fault-injection.txt +++ b/Documentation/fault-injection/fault-injection.txt | |||
@@ -136,7 +136,8 @@ use the boot option: | |||
136 | 136 | ||
137 | o proc entries | 137 | o proc entries |
138 | 138 | ||
139 | - /proc/self/task/<current-tid>/fail-nth: | 139 | - /proc/<pid>/fail-nth: |
140 | - /proc/self/task/<tid>/fail-nth: | ||
140 | 141 | ||
141 | Write to this file of integer N makes N-th call in the task fail. | 142 | Write to this file of integer N makes N-th call in the task fail. |
142 | Read from this file returns a integer value. A value of '0' indicates | 143 | Read from this file returns a integer value. A value of '0' indicates |
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[] = { | |||
2962 | #endif | 2962 | #endif |
2963 | #ifdef CONFIG_FAULT_INJECTION | 2963 | #ifdef CONFIG_FAULT_INJECTION |
2964 | REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), | 2964 | REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), |
2965 | REG("fail-nth", 0644, proc_fail_nth_operations), | ||
2965 | #endif | 2966 | #endif |
2966 | #ifdef CONFIG_ELF_CORE | 2967 | #ifdef CONFIG_ELF_CORE |
2967 | REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), | 2968 | REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), |