svn commit: r195642 - head/sys/fs/nfs

Rick Macklem rmacklem at FreeBSD.org
Sun Jul 12 17:07:36 UTC 2009


Author: rmacklem
Date: Sun Jul 12 17:07:35 2009
New Revision: 195642
URL: http://svn.freebsd.org/changeset/base/195642

Log:
  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)

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonkrpc.c	Sun Jul 12 17:02:17 2009	(r195641)
+++ head/sys/fs/nfs/nfs_commonkrpc.c	Sun Jul 12 17:07:35 2009	(r195642)
@@ -404,7 +404,7 @@ newnfs_request(struct nfsrv_descript *nd
 {
 	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 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
 		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
 		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);
 }
 


More information about the svn-src-head mailing list