summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfs/nfs_commonkrpc.c
diff options
context:
space:
mode:
authorzack <zack@FreeBSD.org>2011-07-16 08:51:09 +0000
committerzack <zack@FreeBSD.org>2011-07-16 08:51:09 +0000
commit1fab7143c5a0cf07ad84fe178bb29590f5cd2733 (patch)
tree692e5096886a1c840f65311eb5a7921341945941 /sys/fs/nfs/nfs_commonkrpc.c
parentcbcc560b1ef4e3268956232dcc43c9f45bbb9e42 (diff)
downloadFreeBSD-src-1fab7143c5a0cf07ad84fe178bb29590f5cd2733.zip
FreeBSD-src-1fab7143c5a0cf07ad84fe178bb29590f5cd2733.tar.gz
Add DEXITCODE plumbing to NFS.
Isilon has the concept of an in-memory exit-code ring that saves the last exit code of a function and allows for stack tracing. This is very helpful when debugging tough issues. This patch is essentially a no-op for BSD at this point, until we upstream the dexitcode logic itself. The patch adds DEXITCODE calls to every NFS function that returns an errno error code. A number of code paths were also reorganized to have single exit paths, to reduce code duplication. Submitted by: David Kwan <dkwan@isilon.com> Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfs/nfs_commonkrpc.c')
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index f658ac8..ca629d2 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -166,7 +166,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp,
CLIENT *client;
struct netconfig *nconf;
struct socket *so;
- int one = 1, retries, error;
+ int one = 1, retries, error = 0;
struct thread *td = curthread;
/*
@@ -222,7 +222,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp,
nrp->nr_soproto, td->td_ucred, td);
if (error) {
td->td_ucred = origcred;
- return (error);
+ goto out;
}
do {
if (error != 0 && pktscale > 2)
@@ -253,7 +253,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp,
soclose(so);
if (error) {
td->td_ucred = origcred;
- return (error);
+ goto out;
}
client = clnt_reconnect_create(nconf, saddr, nrp->nr_prog,
@@ -307,7 +307,10 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp,
/* Restore current thread's credentials. */
td->td_ucred = origcred;
- return (0);
+
+out:
+ NFSEXITCODE(error);
+ return (error);
}
/*
OpenPOWER on IntegriCloud