NetBSD Problem Report #51870

From www@NetBSD.org  Sat Jan 14 04:31:58 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C4C117A268
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 14 Jan 2017 04:31:58 +0000 (UTC)
Message-Id: <20170114043157.AA0037A2A4@mollari.NetBSD.org>
Date: Sat, 14 Jan 2017 04:31:57 +0000 (UTC)
From: yaneurabeya@gmail.com
Reply-To: yaneurabeya@gmail.com
To: gnats-bugs@NetBSD.org
Subject: [PATCH] tests/fs/tmpfs: various fixes from FreeBSD
X-Send-Pr-Version: www-1.0

>Number:         51870
>Category:       bin
>Synopsis:       [PATCH] tests/fs/tmpfs: various fixes from FreeBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 14 04:35:00 +0000 2017
>Closed-Date:    Wed Jan 17 00:23:42 +0000 2018
>Last-Modified:  Wed Jan 17 00:25:02 +0000 2018
>Originator:     Ngie Cooper
>Release:        7.0.2
>Organization:
>Environment:
n/a
>Description:
tests/fs/tmpfs/h_tools.c:
- Add inttypes.h #include for PR* macros.
- close fd when done to prevent leak.
- use correct socket length when calling bind(2).

tests/fs/tmpfs/t_*:
- Use "sysctl -n .." instead of "sysctl .. | cut -d ' ' -f 3)
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/51870: [PATCH] tests/fs/tmpfs: various fixes from FreeBSD
Date: Fri, 13 Jan 2017 20:37:41 -0800

 --Apple-Mail=_8E9538A0-C2C0-4471-A6F6-61041E4274BD
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 Patch attached.
 -Ngie

 --Apple-Mail=_8E9538A0-C2C0-4471-A6F6-61041E4274BD
 Content-Disposition: attachment;
 	filename=tests-fs-tmpfs-various-fixes.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="tests-fs-tmpfs-various-fixes.patch"
 Content-Transfer-Encoding: 7bit

 ? fs/tmpfs/obj
 Index: fs/tmpfs/h_tools.c
 ===================================================================
 RCS file: /cvsroot/src/tests/fs/tmpfs/h_tools.c,v
 retrieving revision 1.4
 diff -u -r1.4 h_tools.c
 --- fs/tmpfs/h_tools.c	11 Jun 2011 18:03:17 -0000	1.4
 +++ fs/tmpfs/h_tools.c	14 Jan 2017 04:32:12 -0000
 @@ -45,6 +45,7 @@
  #include <err.h>
  #include <errno.h>
  #include <fcntl.h>
 +#include <inttypes.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
 @@ -230,12 +231,13 @@
  		return EXIT_FAILURE;
  	}

 +	memset(&addr, 0, sizeof(addr));
  	(void)strlcpy(addr.sun_path, argv[1], sizeof(addr.sun_path));
  	addr.sun_family = PF_UNIX;
 -
 -	error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
 +	error = bind(fd, (struct sockaddr *)&addr, SUN_LEN(&addr));
  	if (error == -1) {
  		warn("connect");
 +		(void)close(fd);
  		return EXIT_FAILURE;
  	}

 Index: fs/tmpfs/t_sizes.sh
 ===================================================================
 RCS file: /cvsroot/src/tests/fs/tmpfs/t_sizes.sh,v
 retrieving revision 1.5
 diff -u -r1.5 t_sizes.sh
 --- fs/tmpfs/t_sizes.sh	7 Nov 2010 17:51:18 -0000	1.5
 +++ fs/tmpfs/t_sizes.sh	14 Jan 2017 04:32:12 -0000
 @@ -54,7 +54,7 @@
  big_body() {
  	test_mount -o -s10M

 -	pagesize=$(sysctl hw.pagesize | cut -d ' ' -f 3)
 +	pagesize=$(sysctl -n hw.pagesize)
  	eval $($(atf_get_srcdir)/h_tools statvfs . | sed -e 's|^f_|cf_|')
  	cf_bused=$((${cf_blocks} - ${cf_bfree}))

 Index: fs/tmpfs/t_statvfs.sh
 ===================================================================
 RCS file: /cvsroot/src/tests/fs/tmpfs/t_statvfs.sh,v
 retrieving revision 1.4
 diff -u -r1.4 t_statvfs.sh
 --- fs/tmpfs/t_statvfs.sh	7 Nov 2010 17:51:18 -0000	1.4
 +++ fs/tmpfs/t_statvfs.sh	14 Jan 2017 04:32:12 -0000
 @@ -38,7 +38,7 @@
  values_body() {
  	test_mount -o -s10M

 -	pagesize=$(sysctl hw.pagesize | cut -d ' ' -f 3)
 +	pagesize=$(sysctl -n hw.pagesize)
  	eval $($(atf_get_srcdir)/h_tools statvfs .)
  	[ ${pagesize} -eq ${f_bsize} ] || \
  	    atf_fail "Invalid bsize"
 Index: fs/tmpfs/t_vnode_leak.sh
 ===================================================================
 RCS file: /cvsroot/src/tests/fs/tmpfs/t_vnode_leak.sh,v
 retrieving revision 1.6
 diff -u -r1.6 t_vnode_leak.sh
 --- fs/tmpfs/t_vnode_leak.sh	7 Nov 2010 17:51:18 -0000	1.6
 +++ fs/tmpfs/t_vnode_leak.sh	14 Jan 2017 04:32:12 -0000
 @@ -36,7 +36,7 @@
  }
  main_body() {
  	echo "Lowering kern.maxvnodes to 2000"
 -	sysctl kern.maxvnodes | awk '{ print $3; }' >oldvnodes
 +	sysctl -n kern.maxvnodes >oldvnodes
  	atf_check -s eq:0 -o ignore -e empty sysctl -w kern.maxvnodes=2000

  	test_mount -o -s$(((4000 + 2) * 4096))

 --Apple-Mail=_8E9538A0-C2C0-4471-A6F6-61041E4274BD--

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: bin/51870: [PATCH] tests/fs/tmpfs: various fixes from FreeBSD
Date: Sun, 15 Jan 2017 13:36:38 -0800

 Hi!
 	I was wondering if there=E2=80=99s anything I need to do in =
 order for this patch to be accepted with NetBSD.
 Thanks!
 -Ngie=

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Wed, 17 Jan 2018 00:23:42 +0000
State-Changed-Why:
Applied, thanks!


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51870 CVS commit: src/tests/fs/tmpfs
Date: Wed, 17 Jan 2018 00:22:29 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Wed Jan 17 00:22:29 UTC 2018

 Modified Files:
 	src/tests/fs/tmpfs: h_tools.c

 Log Message:
 - Add inttypes.h #include for PR* macros.
 - close fd when done to prevent leak.
 - use correct socket length when calling bind(2).

 From Ngie Cooper in PR bin/51870


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/tests/fs/tmpfs/h_tools.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51870 CVS commit: src/tests/fs/tmpfs
Date: Wed, 17 Jan 2018 00:23:18 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Wed Jan 17 00:23:17 UTC 2018

 Modified Files:
 	src/tests/fs/tmpfs: t_sizes.sh t_statvfs.sh t_vnode_leak.sh

 Log Message:
 Use sysctl -n rather than parse the output.

 From Ngie Cooper in PR bin/51870


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 src/tests/fs/tmpfs/t_sizes.sh
 cvs rdiff -u -r1.4 -r1.5 src/tests/fs/tmpfs/t_statvfs.sh
 cvs rdiff -u -r1.6 -r1.7 src/tests/fs/tmpfs/t_vnode_leak.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.