svn commit: r202438 - stable/8/sys/nfsserver

Marius Strobl marius at FreeBSD.org
Sat Jan 16 12:16:38 UTC 2010


Author: marius
Date: Sat Jan 16 12:16:38 2010
New Revision: 202438
URL: http://svn.freebsd.org/changeset/base/202438

Log:
  MFC: r201896
  
  As nfsm_srvmtofh_xx() assumes the 4-byte alignment required by XDR
  ensure the mbuf data is aligned accordingly by calling nfs_realign()
  in fha_extract_info(). This fix is orthogonal to the problem solved
  by r199274/r199284 (MFC'ed to stable/8 in r199733).
  
  PR:		142102 (second part)

Modified:
  stable/8/sys/nfsserver/nfs.h
  stable/8/sys/nfsserver/nfs_fha.c
  stable/8/sys/nfsserver/nfs_srvkrpc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/nfsserver/nfs.h
==============================================================================
--- stable/8/sys/nfsserver/nfs.h	Sat Jan 16 09:52:49 2010	(r202437)
+++ stable/8/sys/nfsserver/nfs.h	Sat Jan 16 12:16:38 2010	(r202438)
@@ -240,6 +240,7 @@ extern int nfs_debug;
 
 #endif
 
+void	nfs_realign(struct mbuf **);
 struct mbuf *nfs_rephead(int, struct nfsrv_descript *, int, struct mbuf **,
 	    caddr_t *);
 void	nfsm_srvfattr(struct nfsrv_descript *, struct vattr *,

Modified: stable/8/sys/nfsserver/nfs_fha.c
==============================================================================
--- stable/8/sys/nfsserver/nfs_fha.c	Sat Jan 16 09:52:49 2010	(r202437)
+++ stable/8/sys/nfsserver/nfs_fha.c	Sat Jan 16 12:16:38 2010	(r202438)
@@ -158,9 +158,9 @@ SYSUNINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_
 static void
 fha_extract_info(struct svc_req *req, struct fha_info *i)
 {
-	struct mbuf *md = req->rq_args;
+	struct mbuf *md;
 	nfsfh_t fh;
-	caddr_t dpos = mtod(md, caddr_t);
+	caddr_t dpos;
 	static u_int64_t random_fh = 0;
 	int error;
 	int v3 = (req->rq_vers == 3);
@@ -201,6 +201,10 @@ fha_extract_info(struct svc_req *req, st
 	    procnum == NFSPROC_NULL)
 		goto out;
 	
+	nfs_realign(&req->rq_args);
+	md = req->rq_args;
+	dpos = mtod(md, caddr_t);
+
 	/* Grab the filehandle. */
 	error = nfsm_srvmtofh_xx(&fh.fh_generic, v3, &md, &dpos);
 	if (error)

Modified: stable/8/sys/nfsserver/nfs_srvkrpc.c
==============================================================================
--- stable/8/sys/nfsserver/nfs_srvkrpc.c	Sat Jan 16 09:52:49 2010	(r202437)
+++ stable/8/sys/nfsserver/nfs_srvkrpc.c	Sat Jan 16 12:16:38 2010	(r202438)
@@ -266,7 +266,7 @@ nfs_rephead(int siz, struct nfsrv_descri
  *	not occur with NFS/UDP and is supposed to only occassionally occur
  *	with TCP.  Use vfs.nfs.realign_count and realign_test to check this.
  */
-static void
+void
 nfs_realign(struct mbuf **pm)	/* XXX COMMON */
 {
 	struct mbuf *m;


More information about the svn-src-stable mailing list