NFSD: Added fault injection
commit65178db42a02c7984f711614546e97e9952d8e01
authorBryan Schumaker <bjschuma@netapp.com>
Tue, 1 Nov 2011 17:35:21 +0000 (1 13:35 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 8 Nov 2011 02:10:47 +0000 (7 21:10 -0500)
treebab2974af726bb7be58e9cc7045cdf7c63b041b7
parent64a284d07c7d84299a90826950079a8ef11e8204
NFSD: Added fault injection

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>
fs/nfsd/Kconfig
fs/nfsd/Makefile
fs/nfsd/fault_inject.c [new file with mode: 0644]
fs/nfsd/fault_inject.h [new file with mode: 0644]
fs/nfsd/nfs4state.c
fs/nfsd/nfsctl.c