summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-07-12 17:07:35 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-07-12 17:07:35 +0000
commita3e6ec19e5a1ba4e009853980224b908177a136a (patch)
treee905e02dbac48ed7e3539779fd2eb333d07a4ef0
parent049621beb5d8c1bc0f11998d3b3447df970cb552 (diff)
downloadFreeBSD-src-a3e6ec19e5a1ba4e009853980224b908177a136a.zip
FreeBSD-src-a3e6ec19e5a1ba4e009853980224b908177a136a.tar.gz
Add calls to the experimental nfs client for the case of an "intr" mount,
so that signals that aren't supposed to terminate RPCs in progress are masked off during the RPC. Approved by: re (kensmith), kib (mentor)
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index 1f0cb55..8b6ada3 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -404,7 +404,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
{
u_int32_t *tl;
time_t waituntil;
- int i, j, set_uid = 0;
+ int i, j, set_uid = 0, set_sigset = 0;
int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS;
u_int16_t procnum;
u_int trylater_delay = 1;
@@ -416,6 +416,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
struct nfsreq *rep = NULL;
char *srv_principal = NULL;
uid_t saved_uid = (uid_t)-1;
+ sigset_t oldset;
if (xidp != NULL)
*xidp = 0;
@@ -425,6 +426,12 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
return (ESTALE);
}
+ /* For client side interruptible mounts, mask off the signals. */
+ if (nmp != NULL && td != NULL && NFSHASINT(nmp)) {
+ newnfs_set_sigmask(td, &oldset);
+ set_sigset = 1;
+ }
+
/*
* XXX if not already connected call nfs_connect now. Longer
* term, change nfs_mount to call nfs_connect unconditionally
@@ -507,6 +514,8 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
cred->cr_uid = saved_uid;
if (auth == NULL) {
m_freem(nd->nd_mreq);
+ if (set_sigset)
+ newnfs_restore_sigmask(td, &oldset);
return (EACCES);
}
bzero(&ext, sizeof(ext));
@@ -598,6 +607,8 @@ tryagain:
AUTH_DESTROY(auth);
if (rep != NULL)
FREE((caddr_t)rep, M_NFSDREQ);
+ if (set_sigset)
+ newnfs_restore_sigmask(td, &oldset);
return (error);
}
@@ -728,6 +739,8 @@ tryagain:
AUTH_DESTROY(auth);
if (rep != NULL)
FREE((caddr_t)rep, M_NFSDREQ);
+ if (set_sigset)
+ newnfs_restore_sigmask(td, &oldset);
return (0);
nfsmout:
mbuf_freem(nd->nd_mrep);
@@ -735,6 +748,8 @@ nfsmout:
AUTH_DESTROY(auth);
if (rep != NULL)
FREE((caddr_t)rep, M_NFSDREQ);
+ if (set_sigset)
+ newnfs_restore_sigmask(td, &oldset);
return (error);
}
OpenPOWER on IntegriCloud