From 089f366ab0b043c5d066ad77628bf155b973df7f Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Sun, 12 Jul 2009 17:07:35 +0000 Subject: 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) --- sys/fs/nfs/nfs_commonkrpc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 1f0cb551700f..8b6ada3865f3 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); } -- cgit v1.3