mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 08:02:07 +00:00
65178db42a
Fault injection on the NFS server makes it easier to test the client's state manager and recovery threads. Simulating errors on the server is easier than finding the right conditions that cause them naturally. This patch uses debugfs to add a simple framework for fault injection to the server. This framework is a config option, and can be enabled through CONFIG_NFSD_FAULT_INJECTION. Assuming you have debugfs mounted to /sys/debug, a set of files will be created in /sys/debug/nfsd/. Writing to any of these files will cause the corresponding action and write a log entry to dmesg. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
29 lines
955 B
C
29 lines
955 B
C
/*
|
|
* Copyright (c) 2011 Bryan Schumaker <bjschuma@netapp.com>
|
|
*
|
|
* Function definitions for fault injection
|
|
*/
|
|
|
|
#ifndef LINUX_NFSD_FAULT_INJECT_H
|
|
#define LINUX_NFSD_FAULT_INJECT_H
|
|
|
|
#ifdef CONFIG_NFSD_FAULT_INJECTION
|
|
int nfsd_fault_inject_init(void);
|
|
void nfsd_fault_inject_cleanup(void);
|
|
void nfsd_forget_clients(u64);
|
|
void nfsd_forget_locks(u64);
|
|
void nfsd_forget_openowners(u64);
|
|
void nfsd_forget_delegations(u64);
|
|
void nfsd_recall_delegations(u64);
|
|
#else /* CONFIG_NFSD_FAULT_INJECTION */
|
|
static inline int nfsd_fault_inject_init(void) { return 0; }
|
|
static inline void nfsd_fault_inject_cleanup(void) {}
|
|
static inline void nfsd_forget_clients(u64 num) {}
|
|
static inline void nfsd_forget_locks(u64 num) {}
|
|
static inline void nfsd_forget_openowners(u64 num) {}
|
|
static inline void nfsd_forget_delegations(u64 num) {}
|
|
static inline void nfsd_recall_delegations(u64 num) {}
|
|
#endif /* CONFIG_NFSD_FAULT_INJECTION */
|
|
|
|
#endif /* LINUX_NFSD_FAULT_INJECT_H */
|