From owner-freebsd-standards@FreeBSD.ORG  Mon May  7 11:07:23 2012
Return-Path: <owner-freebsd-standards@FreeBSD.ORG>
Delivered-To: freebsd-standards@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5D8AD1065675
	for <freebsd-standards@FreeBSD.org>;
	Mon,  7 May 2012 11:07:23 +0000 (UTC)
	(envelope-from owner-bugmaster@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E2638FC08
	for <freebsd-standards@FreeBSD.org>;
	Mon,  7 May 2012 11:07:23 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q47B7NrM072512
	for <freebsd-standards@FreeBSD.org>; Mon, 7 May 2012 11:07:23 GMT
	(envelope-from owner-bugmaster@FreeBSD.org)
Received: (from gnats@localhost)
	by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q47B7Mce072510
	for freebsd-standards@FreeBSD.org; Mon, 7 May 2012 11:07:22 GMT
	(envelope-from owner-bugmaster@FreeBSD.org)
Date: Mon, 7 May 2012 11:07:22 GMT
Message-Id: <201205071107.q47B7Mce072510@freefall.freebsd.org>
X-Authentication-Warning: freefall.freebsd.org: gnats set sender to
	owner-bugmaster@FreeBSD.org using -f
From: FreeBSD bugmaster <bugmaster@FreeBSD.org>
To: freebsd-standards@FreeBSD.org
Cc: 
Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org
X-BeenThere: freebsd-standards@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Standards compliance <freebsd-standards.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-standards>, 
	<mailto:freebsd-standards-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-standards>
List-Post: <mailto:freebsd-standards@freebsd.org>
List-Help: <mailto:freebsd-standards-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-standards>, 
	<mailto:freebsd-standards-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 07 May 2012 11:07:23 -0000

Note: to view an individual PR, use:
  http://www.freebsd.org/cgi/query-pr.cgi?pr=(number).

The following is a listing of current problems submitted by FreeBSD users.
These represent problem reports covering all versions including
experimental development code and obsolete releases.


S Tracker      Resp.      Description
--------------------------------------------------------------------------------
o stand/166349 standards  Support the assignment-allocation character for fscanf
o stand/165236 standards  The NONE Wi-Fi regulatory restricts use of channels 12
o stand/164787 standards  dirfd() function not available when _POSIX_C_SOURCE is
o kern/164674  standards  [patch] [libc] vfprintf/vfwprintf return error (EOF) o
o stand/162434 standards  getaddrinfo: addrinfo.ai_family is an address family, 
o stand/154842 standards  invalid request authenticator in the second and subseq
o stand/150093 standards  C++ std::locale support is broken
o stand/130067 standards  Wrong numeric limits in system headers?
o stand/124860 standards  flockfile(3) doesn't work when the memory has been exh
o stand/121921 standards  [patch] Add leap second support to at(1), atrun(8)
o stand/116477 standards  rm(1): rm behaves unexpectedly when using -r and relat
o bin/116413   standards  incorrect getconf(1) handling of unsigned constants gi
o stand/116081 standards  make does not work with the directive sinclude
p stand/107561 standards  [libc] [patch] [request] Missing SUS function tcgetsid
o stand/100017 standards  [Patch] Add fuser(1) functionality to fstat(1)
a stand/86484  standards  [patch] mkfifo(1) uses wrong permissions
o stand/82654  standards  C99 long double math functions are missing
o stand/81287  standards  [patch] fingerd(8) might send a line not ending in CRL
a stand/80293  standards  sysconf() does not support well-defined unistd values
o stand/79056  standards  [feature request] [atch] regex(3) regression tests
o stand/70813  standards  [patch] ls(1) not Posix compliant
o stand/66357  standards  make POSIX conformance problem ('sh -e' & '+' command-
s kern/64875   standards  [libc] [patch] [request] add a system call: fdatasync(
o stand/56476  standards  [patch] cd9660 unicode support simple hack
o stand/54410  standards  one-true-awk not POSIX compliant (no extended REs)
o stand/46119  standards  Priority problems for SCHED_OTHER using pthreads
o stand/44365  standards  [headers] [patch] [request] introduce ulong and unchar
a stand/41576  standards  ln(1): replacing old dir-symlinks
a docs/26003   standards  getgroups(2) lists NGROUPS_MAX but not syslimits.h
s stand/24590  standards  timezone function not compatible witn Single Unix Spec
o stand/21519  standards  sys/dir.h should be deprecated some more
s bin/14925    standards  getsubopt isn't poisonous enough

32 problems total.


From owner-freebsd-standards@FreeBSD.ORG  Thu May 10 18:40:14 2012
Return-Path: <owner-freebsd-standards@FreeBSD.ORG>
Delivered-To: freebsd-standards@hub.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 429A0106574B
	for <freebsd-standards@hub.freebsd.org>;
	Thu, 10 May 2012 18:40:14 +0000 (UTC)
	(envelope-from gnats@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id B4E9B8FC1B
	for <freebsd-standards@hub.freebsd.org>;
	Thu, 10 May 2012 18:40:13 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4AIeDk0036788
	for <freebsd-standards@freefall.freebsd.org>;
	Thu, 10 May 2012 18:40:13 GMT
	(envelope-from gnats@freefall.freebsd.org)
Received: (from gnats@localhost)
	by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4AIeDjR036787;
	Thu, 10 May 2012 18:40:13 GMT (envelope-from gnats)
Resent-Date: Thu, 10 May 2012 18:40:13 GMT
Resent-Message-Id: <201205101840.q4AIeDjR036787@freefall.freebsd.org>
Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer)
Resent-To: freebsd-standards@FreeBSD.org
Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org,
	Shesha Sreenivasamurthy <sheshas@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 3CA6B1065672
	for <freebsd-gnats-submit@FreeBSD.org>;
	Thu, 10 May 2012 18:34:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 27B1D8FC21
	for <freebsd-gnats-submit@FreeBSD.org>;
	Thu, 10 May 2012 18:34:38 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4AIYcdk073652
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 May 2012 18:34:38 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q4AIYb64073617;
	Thu, 10 May 2012 18:34:37 GMT (envelope-from nobody)
Message-Id: <201205101834.q4AIYb64073617@red.freebsd.org>
Date: Thu, 10 May 2012 18:34:37 GMT
From: Shesha Sreenivasamurthy <sheshas@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
X-Send-Pr-Version: www-3.1
Cc: 
Subject: standards/167779: makefs does not create sparse file
X-BeenThere: freebsd-standards@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Standards compliance <freebsd-standards.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-standards>, 
	<mailto:freebsd-standards-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-standards>
List-Post: <mailto:freebsd-standards@freebsd.org>
List-Help: <mailto:freebsd-standards-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-standards>, 
	<mailto:freebsd-standards-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 10 May 2012 18:40:14 -0000


>Number:         167779
>Category:       standards
>Synopsis:       makefs does not create sparse file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 10 18:40:13 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Shesha Sreenivasamurthy
>Release:        freebsd 9.0
>Organization:
Juniper Networks
>Environment:
>Description:
When a file system is laid out using makefs, then it zeros out the size of the file specified. This is not essentially needed. We can just create a container, so that the file thus created is sparse. This is particularly helpful we we are creating a disk image for a VM (Virtual Machine). This,

 1. It reduces the creation time significantly.
 2. Copying around is less time consuming (Tools like rsync and cp can deal efficiently with sparse files)
 3. Easily fits the image into a CD without additional processing like 'cp --sparse=Always' etc.
>How-To-Repeat:
Just create a filesystem using makefs by specifying a file size:

makefs -t ffs -s 4G -o version=1 <filename> <dirname>

'du -sh' as well as 'ls -lh' on the file thus created shows 4GB.
>Fix:
Add another option '-p' for sparse and seek to the size instead of filling with zeros.

Patch attached with submission follows:

*** usr/src/usr.sbin/makefs/makefs.c	2012-04-22 22:38:49.000000000 -0700
--- ../9/usr/src/usr.sbin/makefs/makefs.c	2012-01-02 19:25:41.000000000 -0800
***************
*** 112,118 ****
  	start_time.tv_sec = start.tv_sec;
  	start_time.tv_nsec = start.tv_usec * 1000;
  
! 	while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:o:s:S:t:xp")) != -1) {
  		switch (ch) {
  
  		case 'B':
--- 112,118 ----
  	start_time.tv_sec = start.tv_sec;
  	start_time.tv_nsec = start.tv_usec * 1000;
  
! 	while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:o:s:S:t:x")) != -1) {
  		switch (ch) {
  
  		case 'B':
***************
*** 224,232 ****
  		case 'x':
  			fsoptions.onlyspec = 1;
  			break;
! 		case 'p':
! 			fsoptions.sparse = 1;
! 			break;
  		case '?':
  		default:
  			usage();
--- 224,230 ----
  		case 'x':
  			fsoptions.onlyspec = 1;
  			break;
! 
  		case '?':
  		default:
  			usage();
***************
*** 337,343 ****
  	fprintf(stderr,
  "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"
  "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n"
! "\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x] [-p sparse]\n"
  "\t[-N userdb-dir] image-file directory | manifest\n",
  	    prog);
  	exit(1);
--- 335,341 ----
  	fprintf(stderr,
  "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"
  "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n"
! "\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n"
  "\t[-N userdb-dir] image-file directory | manifest\n",
  	    prog);
  	exit(1);
*** usr/src/usr.sbin/makefs/makefs.h	2012-04-22 22:49:25.000000000 -0700
--- ../9/usr/src/usr.sbin/makefs/makefs.h	2012-01-02 19:25:41.000000000 -0800
***************
*** 127,133 ****
  	int	freeblockpc;	/* free block % */
  	int	needswap;	/* non-zero if byte swapping needed */
  	int	sectorsize;	/* sector size */
- 	int	sparse;		/* sparse image, don't fill it with zeros */
  
  	void	*fs_specific;	/* File system specific additions. */
  } fsinfo_t;
--- 127,132 ----
*** usr/src/usr.sbin/makefs/ffs.c	2012-04-30 16:06:01.715365000 -0700
--- ../9/usr/src/usr.sbin/makefs/ffs.c	2012-01-02 19:25:41.000000000 -0800
***************
*** 493,508 ****
  		bufsize = sfs.f_iosize;
  #endif
  	bufrem = fsopts->size;
- 
- 	if (fsopts->sparse) {
- 		if (lseek(fsopts->fd, bufrem - bufsize, SEEK_SET) == -1) {
- 			printf ("ERROR in lseek. Sparse option disabled\n");
- 			fsopts->sparse = 0;
- 		} else {
- 			bufrem = bufsize; /* Seek to end and write one block */
- 		}
- 	}
- 
  	if (debug & DEBUG_FS_CREATE_IMAGE)
  		printf(
  		    "zero-ing image `%s', %lld sectors, using %d byte chunks\n",
--- 493,498 ----


>Release-Note:
>Audit-Trail:
>Unformatted:

From owner-freebsd-standards@FreeBSD.ORG  Thu May 10 18:44:44 2012
Return-Path: <owner-freebsd-standards@FreeBSD.ORG>
Delivered-To: freebsd-standards@hub.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 803C4106566C;
	Thu, 10 May 2012 18:44:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 549B78FC0A;
	Thu, 10 May 2012 18:44:44 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4AIiike044914;
	Thu, 10 May 2012 18:44:44 GMT
	(envelope-from hrs@freefall.freebsd.org)
Received: (from hrs@localhost)
	by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4AIiikd044910;
	Thu, 10 May 2012 18:44:44 GMT (envelope-from hrs)
Date: Thu, 10 May 2012 18:44:44 GMT
Message-Id: <201205101844.q4AIiikd044910@freefall.freebsd.org>
To: hrs@FreeBSD.org, freebsd-standards@FreeBSD.org, hrs@FreeBSD.org
From: hrs@FreeBSD.org
Cc: 
Subject: Re: bin/167779: makefs does not create sparse file
X-BeenThere: freebsd-standards@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Standards compliance <freebsd-standards.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-standards>, 
	<mailto:freebsd-standards-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-standards>
List-Post: <mailto:freebsd-standards@freebsd.org>
List-Help: <mailto:freebsd-standards-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-standards>, 
	<mailto:freebsd-standards-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 10 May 2012 18:44:44 -0000

Synopsis: makefs does not create sparse file

Responsible-Changed-From-To: freebsd-standards->hrs
Responsible-Changed-By: hrs
Responsible-Changed-When: Thu May 10 18:44:10 UTC 2012
Responsible-Changed-Why: 
I'll take this.

http://www.freebsd.org/cgi/query-pr.cgi?pr=167779