Module Name: src
Committed By: maxv
Date: Sat Jul 13 14:24:37 UTC 2019
Modified Files:
src/sys/fs/tmpfs: tmpfs_mem.c
Log Message:
Remove the roundups, they are incorrect and cause memcmp to wrongfully fail
because of uninitialized bytes at the end of the buffers.
ok rmind@
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/fs/tmpfs/tmpfs_mem.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/fs/tmpfs/tmpfs_mem.c
diff -u src/sys/fs/tmpfs/tmpfs_mem.c:1.9 src/sys/fs/tmpfs/tmpfs_mem.c:1.10
--- src/sys/fs/tmpfs/tmpfs_mem.c:1.9 Mon Aug 22 23:07:36 2016
+++ src/sys/fs/tmpfs/tmpfs_mem.c Sat Jul 13 14:24:37 2019
@@ -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 @@ tmpfs_strname_free(struct tmpfs_mount *m
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);
}