NFSD: Lock state before calling fault injection function

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>
This commit is contained in:
Bryan Schumaker 2012-11-29 11:40:38 -05:00 committed by J. Bruce Fields
parent e5f9570319
commit 043958395a
2 changed files with 4 additions and 16 deletions

View file

@ -51,7 +51,9 @@ static int nfsd_inject_set(void *op_ptr, u64 val)
else
printk(KERN_INFO "NFSD Fault Injection: %s (n = %llu)", op->file, val);
nfs4_lock_state();
op->func(val);
nfs4_unlock_state();
return 0;
}