Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) #include <linux/random.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #include <linux/stat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/export.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/stacktrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/fault-inject.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * setup_fault_attr() is a helper function for various __setup handlers, so it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * returns 0 on error, because that is what __setup handlers do.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) int setup_fault_attr(struct fault_attr *attr, char *str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	unsigned long probability;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	unsigned long interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	int times;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	int space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	/* "<interval>,<probability>,<space>,<times>" */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	if (sscanf(str, "%lu,%lu,%d,%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 			&interval, &probability, &space, &times) < 4) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 		printk(KERN_WARNING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 			"FAULT_INJECTION: failed to parse arguments\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	attr->probability = probability;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	attr->interval = interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	atomic_set(&attr->times, times);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	atomic_set(&attr->space, space);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) EXPORT_SYMBOL_GPL(setup_fault_attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) static void fail_dump(struct fault_attr *attr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	if (attr->verbose > 0 && __ratelimit(&attr->ratelimit_state)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		printk(KERN_NOTICE "FAULT_INJECTION: forcing a failure.\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 		       "name %pd, interval %lu, probability %lu, "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		       "space %d, times %d\n", attr->dname,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 		       attr->interval, attr->probability,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		       atomic_read(&attr->space),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		       atomic_read(&attr->times));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		if (attr->verbose > 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 			dump_stack();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) #define atomic_dec_not_zero(v)		atomic_add_unless((v), -1, 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) static bool fail_task(struct fault_attr *attr, struct task_struct *task)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	return in_task() && task->make_it_fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #define MAX_STACK_TRACE_DEPTH 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) static bool fail_stacktrace(struct fault_attr *attr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	int depth = attr->stacktrace_depth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	unsigned long entries[MAX_STACK_TRACE_DEPTH];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	int n, nr_entries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	bool found = (attr->require_start == 0 && attr->require_end == ULONG_MAX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	if (depth == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		return found;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	nr_entries = stack_trace_save(entries, depth, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	for (n = 0; n < nr_entries; n++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		if (attr->reject_start <= entries[n] &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 			       entries[n] < attr->reject_end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 			return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		if (attr->require_start <= entries[n] &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			       entries[n] < attr->require_end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 			found = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	return found;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) static inline bool fail_stacktrace(struct fault_attr *attr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  * This code is stolen from failmalloc-1.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  * http://www.nongnu.org/failmalloc/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) bool should_fail(struct fault_attr *attr, ssize_t size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	if (in_task()) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		unsigned int fail_nth = READ_ONCE(current->fail_nth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		if (fail_nth) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 			fail_nth--;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 			WRITE_ONCE(current->fail_nth, fail_nth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 			if (!fail_nth)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 				goto fail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 			return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	/* No need to check any other properties if the probability is 0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	if (attr->probability == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	if (attr->task_filter && !fail_task(attr, current))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	if (atomic_read(&attr->times) == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	if (atomic_read(&attr->space) > size) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		atomic_sub(size, &attr->space);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	if (attr->interval > 1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		attr->count++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		if (attr->count % attr->interval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 			return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	if (attr->probability <= prandom_u32() % 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	if (!fail_stacktrace(attr))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) fail:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	fail_dump(attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	if (atomic_read(&attr->times) != -1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		atomic_dec_not_zero(&attr->times);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) EXPORT_SYMBOL_GPL(should_fail);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) static int debugfs_ul_set(void *data, u64 val)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	*(unsigned long *)data = val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) static int debugfs_ul_get(void *data, u64 *val)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	*val = *(unsigned long *)data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) static void debugfs_create_ul(const char *name, umode_t mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 			      struct dentry *parent, unsigned long *value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	debugfs_create_file(name, mode, parent, value, &fops_ul);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) static int debugfs_stacktrace_depth_set(void *data, u64 val)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	*(unsigned long *)data =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		min_t(unsigned long, val, MAX_STACK_TRACE_DEPTH);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) DEFINE_SIMPLE_ATTRIBUTE(fops_stacktrace_depth, debugfs_ul_get,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 			debugfs_stacktrace_depth_set, "%llu\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) static void debugfs_create_stacktrace_depth(const char *name, umode_t mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 					    struct dentry *parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 					    unsigned long *value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	debugfs_create_file(name, mode, parent, value, &fops_stacktrace_depth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) struct dentry *fault_create_debugfs_attr(const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 			struct dentry *parent, struct fault_attr *attr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	umode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	struct dentry *dir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	dir = debugfs_create_dir(name, parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	if (IS_ERR(dir))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 		return dir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	debugfs_create_ul("probability", mode, dir, &attr->probability);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	debugfs_create_ul("interval", mode, dir, &attr->interval);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	debugfs_create_atomic_t("times", mode, dir, &attr->times);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	debugfs_create_atomic_t("space", mode, dir, &attr->space);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	debugfs_create_ul("verbose", mode, dir, &attr->verbose);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	debugfs_create_u32("verbose_ratelimit_interval_ms", mode, dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			   &attr->ratelimit_state.interval);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	debugfs_create_u32("verbose_ratelimit_burst", mode, dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 			   &attr->ratelimit_state.burst);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	debugfs_create_bool("task-filter", mode, dir, &attr->task_filter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	debugfs_create_stacktrace_depth("stacktrace-depth", mode, dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 					&attr->stacktrace_depth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	debugfs_create_ul("require-start", mode, dir, &attr->require_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	debugfs_create_ul("require-end", mode, dir, &attr->require_end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	debugfs_create_ul("reject-start", mode, dir, &attr->reject_start);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	debugfs_create_ul("reject-end", mode, dir, &attr->reject_end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	attr->dname = dget(dir);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	return dir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) EXPORT_SYMBOL_GPL(fault_create_debugfs_attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) #endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */