aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-14 15:26:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-14 15:26:41 -0500
commit0b48d42235caf627121f440b57d376f48a9af8b6 (patch)
tree400967c5fcb1cd08bbc0e1739e229f9717590f19 /Documentation
parent8e63dd6e1c589ba99a18df9cbaa41c3178607641 (diff)
parent7a6ef8c72314f254c107c6a9ed7cb201961ee05a (diff)
Merge branch 'for-3.3' of git://linux-nfs.org/~bfields/linux
* 'for-3.3' of git://linux-nfs.org/~bfields/linux: (31 commits) nfsd4: nfsd4_create_clid_dir return value is unused NFSD: Change name of extended attribute containing junction svcrpc: don't revert to SVC_POOL_DEFAULT on nfsd shutdown svcrpc: fix double-free on shutdown of nfsd after changing pool mode nfsd4: be forgiving in the absence of the recovery directory nfsd4: fix spurious 4.1 post-reboot failures NFSD: forget_delegations should use list_for_each_entry_safe NFSD: Only reinitilize the recall_lru list under the recall lock nfsd4: initialize special stateid's at compile time NFSd: use network-namespace-aware cache registering routines SUNRPC: create svc_xprt in proper network namespace svcrpc: update outdated BKL comment nfsd41: allow non-reclaim open-by-fh's in 4.1 svcrpc: avoid memory-corruption on pool shutdown svcrpc: destroy server sockets all at once svcrpc: make svc_delete_xprt static nfsd: Fix oops when parsing a 0 length export nfsd4: Use kmemdup rather than duplicating its implementation nfsd4: add a separate (lockowner, inode) lookup nfsd4: fix CONFIG_NFSD_FAULT_INJECTION compile error ...
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/filesystems/nfs/00-INDEX2
-rw-r--r--Documentation/filesystems/nfs/fault_injection.txt69
2 files changed, 71 insertions, 0 deletions
diff --git a/Documentation/filesystems/nfs/00-INDEX b/Documentation/filesystems/nfs/00-INDEX
index a57e12411d2a..1716874a651e 100644
--- a/Documentation/filesystems/nfs/00-INDEX
+++ b/Documentation/filesystems/nfs/00-INDEX
@@ -2,6 +2,8 @@
2 - this file (nfs-related documentation). 2 - this file (nfs-related documentation).
3Exporting 3Exporting
4 - explanation of how to make filesystems exportable. 4 - explanation of how to make filesystems exportable.
5fault_injection.txt
6 - information for using fault injection on the server
5knfsd-stats.txt 7knfsd-stats.txt
6 - statistics which the NFS server makes available to user space. 8 - statistics which the NFS server makes available to user space.
7nfs.txt 9nfs.txt
diff --git a/Documentation/filesystems/nfs/fault_injection.txt b/Documentation/filesystems/nfs/fault_injection.txt
new file mode 100644
index 000000000000..426d166089a3
--- /dev/null
+++ b/Documentation/filesystems/nfs/fault_injection.txt
@@ -0,0 +1,69 @@
1
2Fault Injection
3===============
4Fault injection is a method for forcing errors that may not normally occur, or
5may be difficult to reproduce. Forcing these errors in a controlled environment
6can help the developer find and fix bugs before their code is shipped in a
7production system. Injecting an error on the Linux NFS server will allow us to
8observe how the client reacts and if it manages to recover its state correctly.
9
10NFSD_FAULT_INJECTION must be selected when configuring the kernel to use this
11feature.
12
13
14Using Fault Injection
15=====================
16On the client, mount the fault injection server through NFS v4.0+ and do some
17work over NFS (open files, take locks, ...).
18
19On the server, mount the debugfs filesystem to <debug_dir> and ls
20<debug_dir>/nfsd. This will show a list of files that will be used for
21injecting faults on the NFS server. As root, write a number n to the file
22corresponding to the action you want the server to take. The server will then
23process the first n items it finds. So if you want to forget 5 locks, echo '5'
24to <debug_dir>/nfsd/forget_locks. A value of 0 will tell the server to forget
25all corresponding items. A log message will be created containing the number
26of items forgotten (check dmesg).
27
28Go back to work on the client and check if the client recovered from the error
29correctly.
30
31
32Available Faults
33================
34forget_clients:
35 The NFS server keeps a list of clients that have placed a mount call. If
36 this list is cleared, the server will have no knowledge of who the client
37 is, forcing the client to reauthenticate with the server.
38
39forget_openowners:
40 The NFS server keeps a list of what files are currently opened and who
41 they were opened by. Clearing this list will force the client to reopen
42 its files.
43
44forget_locks:
45 The NFS server keeps a list of what files are currently locked in the VFS.
46 Clearing this list will force the client to reclaim its locks (files are
47 unlocked through the VFS as they are cleared from this list).
48
49forget_delegations:
50 A delegation is used to assure the client that a file, or part of a file,
51 has not changed since the delegation was awarded. Clearing this list will
52 force the client to reaquire its delegation before accessing the file
53 again.
54
55recall_delegations:
56 Delegations can be recalled by the server when another client attempts to
57 access a file. This test will notify the client that its delegation has
58 been revoked, forcing the client to reaquire the delegation before using
59 the file again.
60
61
62tools/nfs/inject_faults.sh script
63=================================
64This script has been created to ease the fault injection process. This script
65will detect the mounted debugfs directory and write to the files located there
66based on the arguments passed by the user. For example, running
67`inject_faults.sh forget_locks 1` as root will instruct the server to forget
68one lock. Running `inject_faults forget_locks` will instruct the server to
69forgetall locks.