svn commit: r318168 - stable/11/sys/kern
John Baldwin
jhb at FreeBSD.org
Thu May 11 00:27:28 UTC 2017
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);
More information about the svn-src-all
mailing list