3 # Copyright (c) 2011 Bryan Schumaker <bjschuma@netapp.com>
5 # Script for easier NFSD fault injection
7 # Check that debugfs has been mounted
8 DEBUGFS
=`cat /proc/mounts | grep debugfs`
9 if [ "$DEBUGFS" == "" ]; then
10 echo "debugfs does not appear to be mounted!"
11 echo "Please mount debugfs and try again"
15 # Check that the fault injection directory exists
16 DEBUGDIR
=`echo $DEBUGFS | awk '{print $2}'`/nfsd
17 if [ ! -d "$DEBUGDIR" ]; then
18 echo "$DEBUGDIR does not exist"
19 echo "Check that your .config selects CONFIG_NFSD_FAULT_INJECTION"
25 echo "Usage $0 injection_type [count]"
27 echo "Injection types are:"
34 elif [ ! -f $DEBUGDIR/$1 ]; then
36 elif [ $# != 2 ]; then
45 echo $COUNT > $DEBUGDIR/$1
47 # Capture lines that only exist in the $AFTER file
48 diff $BEFORE $AFTER |
grep ">"