Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b48d422 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
  ...
parents 8e63dd6e 7a6ef8c7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -514,6 +514,11 @@ S: Bessemerstraat 21
S: Amsterdam
S: The Netherlands

N: NeilBrown
E: neil@brown.name
P: 4096R/566281B9 1BC6 29EB D390 D870 7B5F  497A 39EC 9EDD 5662 81B9
D: NFSD Maintainer 2000-2007

N: Zach Brown
E: zab@zabbo.net
D: maestro pci sound
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
	- this file (nfs-related documentation).
Exporting
	- explanation of how to make filesystems exportable.
fault_injection.txt
	- information for using fault injection on the server
knfsd-stats.txt
	- statistics which the NFS server makes available to user space.
nfs.txt
+69 −0
Original line number Diff line number Diff line

Fault Injection
===============
Fault injection is a method for forcing errors that may not normally occur, or
may be difficult to reproduce.  Forcing these errors in a controlled environment
can help the developer find and fix bugs before their code is shipped in a
production system.  Injecting an error on the Linux NFS server will allow us to
observe how the client reacts and if it manages to recover its state correctly.

NFSD_FAULT_INJECTION must be selected when configuring the kernel to use this
feature.


Using Fault Injection
=====================
On the client, mount the fault injection server through NFS v4.0+ and do some
work over NFS (open files, take locks, ...).

On the server, mount the debugfs filesystem to <debug_dir> and ls
<debug_dir>/nfsd.  This will show a list of files that will be used for
injecting faults on the NFS server.  As root, write a number n to the file
corresponding to the action you want the server to take.  The server will then
process the first n items it finds.  So if you want to forget 5 locks, echo '5'
to <debug_dir>/nfsd/forget_locks.  A value of 0 will tell the server to forget
all corresponding items.  A log message will be created containing the number
of items forgotten (check dmesg).

Go back to work on the client and check if the client recovered from the error
correctly.


Available Faults
================
forget_clients:
     The NFS server keeps a list of clients that have placed a mount call.  If
     this list is cleared, the server will have no knowledge of who the client
     is, forcing the client to reauthenticate with the server.

forget_openowners:
     The NFS server keeps a list of what files are currently opened and who
     they were opened by.  Clearing this list will force the client to reopen
     its files.

forget_locks:
     The NFS server keeps a list of what files are currently locked in the VFS.
     Clearing this list will force the client to reclaim its locks (files are
     unlocked through the VFS as they are cleared from this list).

forget_delegations:
     A delegation is used to assure the client that a file, or part of a file,
     has not changed since the delegation was awarded.  Clearing this list will
     force the client to reaquire its delegation before accessing the file
     again.

recall_delegations:
     Delegations can be recalled by the server when another client attempts to
     access a file.  This test will notify the client that its delegation has
     been revoked, forcing the client to reaquire the delegation before using
     the file again.


tools/nfs/inject_faults.sh script
=================================
This script has been created to ease the fault injection process.  This script
will detect the mounted debugfs directory and write to the files located there
based on the arguments passed by the user.  For example, running
`inject_faults.sh forget_locks 1` as root will instruct the server to forget
one lock.  Running `inject_faults forget_locks` will instruct the server to
forgetall locks.
+0 −1
Original line number Diff line number Diff line
@@ -3775,7 +3775,6 @@ S: Odd Fixes

KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
M:	"J. Bruce Fields" <bfields@fieldses.org>
M:	Neil Brown <neilb@suse.de>
L:	linux-nfs@vger.kernel.org
W:	http://nfs.sourceforge.net/
S:	Supported
+10 −0
Original line number Diff line number Diff line
@@ -80,3 +80,13 @@ config NFSD_V4
	  available from http://linux-nfs.org/.

	  If unsure, say N.

config NFSD_FAULT_INJECTION
	bool "NFS server manual fault injection"
	depends on NFSD_V4 && DEBUG_KERNEL
	help
	  This option enables support for manually injecting faults
	  into the NFS server.  This is intended to be used for
	  testing error recovery on the NFS client.

	  If unsure, say N.
Loading