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