Remove the roundups, they are incorrect and cause memcmp to wrongfully fail trunk
authormaxv <maxv@NetBSD.org>
Sat, 13 Jul 2019 14:24:37 +0000
branchtrunk
changeset 452550 8dd7ad8050d6
parent 452549 22396b7380b0
child 452551 5b464ad42f65
Remove the roundups, they are incorrect and cause memcmp to wrongfully fail because of uninitialized bytes at the end of the buffers. ok rmind@
sys/fs/tmpfs/tmpfs_mem.c
--- a/sys/fs/tmpfs/tmpfs_mem.c	Sat Jul 13 12:44:02 2019 +0000
+++ b/sys/fs/tmpfs/tmpfs_mem.c	Sat Jul 13 14:24:37 2019 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_mem.c,v 1.9 2016/08/22 23:07:36 skrll Exp $	*/
+/*	$NetBSD: tmpfs_mem.c,v 1.10 2019/07/13 14:24:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_mem.c,v 1.9 2016/08/22 23:07:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_mem.c,v 1.10 2019/07/13 14:24:37 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -234,8 +234,8 @@
 bool
 tmpfs_strname_neqlen(struct componentname *fcnp, struct componentname *tcnp)
 {
-	const size_t fln = roundup2(fcnp->cn_namelen, TMPFS_NAME_QUANTUM);
-	const size_t tln = roundup2(tcnp->cn_namelen, TMPFS_NAME_QUANTUM);
+	const size_t fln = fcnp->cn_namelen;
+	const size_t tln = tcnp->cn_namelen;
 
 	return (fln != tln) || memcmp(fcnp->cn_nameptr, tcnp->cn_nameptr, fln);
 }