aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/fault_inject.c
Commit message (Collapse)AuthorAge
* NFSD: Correct the size calculation in fault_inject_writeBryan Schumaker2012-12-10
| | | | | | | | If len == 0 we end up with size = (0 - 1), which could cause bad things to happen in copy_from_user(). Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* NFSD: Pass correct buffer size to rpc_ntopBryan Schumaker2012-12-10
| | | | | | | | I honestly have no idea where I got 129 from, but it's a much bigger value than the actual buffer size (INET6_ADDRSTRLEN). Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* NFSD: Forget state for a specific clientBryan Schumaker2012-12-03
| | | | | | | | Write the client's ip address to any state file and all appropriate state for that client will be forgotten. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* NFSD: Add a custom file operations structure for fault injectionBryan Schumaker2012-12-03
| | | | | | | | | Controlling the read and write functions allows me to add in "forget client w.x.y.z", since we won't be limited to reading and writing only u64 values. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* NFSD: Reading a fault injection file prints a state countBryan Schumaker2012-12-03
| | | | | | | | | | I also log basic information that I can figure out about the type of state (such as number of locks for each client IP address). This can be useful for checking that state was actually dropped and later for checking if the client was able to recover. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* NFSD: Fault injection operations take a per-client forget functionBryan Schumaker2012-12-03
| | | | | | | | | | The eventual goal is to forget state based on ip address, so it makes sense to call this function in a for-each-client loop until the correct amount of state is forgotten. I also use this patch as an opportunity to rename the forget function from "func()" to "forget()". Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* NFSD: Lock state before calling fault injection functionBryan Schumaker2012-12-03
| | | | | | | | Each function touches state in some way, so getting the lock earlier can help simplify code. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* NFSD: Fold fault_inject.h into state.hBryan Schumaker2012-11-28
| | | | | | | | | | There were only a small number of functions in this file and since they all affect stored state I think it makes sense to put them in state.h instead. I also dropped most static inline declarations since there are no callers when fault injection is not enabled. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* nfsd: return 0 on reads of fault injection filesWeston Andros Adamson2012-05-31
| | | | | | | debugfs read operations were returning the contents of an uninitialized u64. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* debugfs-related mode_t whack-a-moleAl Viro2012-03-20
| | | | | | all of those should be umode_t... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* NFSD: Added fault injectionBryan Schumaker2011-11-07
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>