Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2017 00:27:26 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318168 - stable/11/sys/kern
Message-ID:  <201705110027.v4B0RQRB027995@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu May 11 00:27:26 2017
New Revision: 318168
URL: https://svnweb.freebsd.org/changeset/base/318168

Log:
  MFC 315323: Use UMA_ALIGN_PTR instead of sizeof(void *) for zone alignment.
  
  uma_zcreate()'s alignment argument is supposed to be sizeof(foo) - 1,
  and uma.h provides a set of helper macros for common types.  Passing
  sizeof(void *) results in all of the members being misaligned triggering
  unaligned access faults on certain architectures (notably MIPS).

Modified:
  stable/11/sys/kern/vfs_lookup.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_lookup.c
==============================================================================
--- stable/11/sys/kern/vfs_lookup.c	Thu May 11 00:23:51 2017	(r318167)
+++ stable/11/sys/kern/vfs_lookup.c	Thu May 11 00:27:26 2017	(r318168)
@@ -153,7 +153,7 @@ nameiinit(void *dummy __unused)
 	namei_zone = uma_zcreate("NAMEI", MAXPATHLEN, NULL, NULL, NULL, NULL,
 	    UMA_ALIGN_PTR, 0);
 	nt_zone = uma_zcreate("rentr", sizeof(struct nameicap_tracker),
-	    NULL, NULL, NULL, NULL, sizeof(void *), 0);
+	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 	getnewvnode("crossmp", NULL, &crossmp_vnodeops, &vp_crossmp);
 }
 SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705110027.v4B0RQRB027995>