From pgpkeys@pgpnet.us  Tue Jun 28 05:45:54 2005
Return-Path: <pgpkeys@pgpnet.us>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DEF0416A45D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 28 Jun 2005 05:45:54 +0000 (GMT)
	(envelope-from pgpkeys@pgpnet.us)
Received: from www.pgpkeys.us (static-141-149-128-140.buff.east.verizon.net [141.149.128.140])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6917F43D49
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 28 Jun 2005 05:45:52 +0000 (GMT)
	(envelope-from pgpkeys@pgpnet.us)
Received: from www.pgpkeys.us (pgpkeys@localhost [127.0.0.1])
	by www.pgpkeys.us (8.13.3/8.13.3) with ESMTP id j5S5jq5o022269
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 28 Jun 2005 01:45:52 -0400 (EDT)
	(envelope-from pgpkeys@www.pgpkeys.us)
Received: (from pgpkeys@localhost)
	by www.pgpkeys.us (8.13.3/8.13.3/Submit) id j5S5jp26022268;
	Tue, 28 Jun 2005 01:45:51 -0400 (EDT)
	(envelope-from pgpkeys)
Message-Id: <200506280545.j5S5jp26022268@www.pgpkeys.us>
Date: Tue, 28 Jun 2005 01:45:51 -0400 (EDT)
From: "David D.W. Downey" <pgpkeys@pgpnet.us>
Reply-To: "David D.W. Downey" <pgpkeys@pgpnet.us>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] Incorrect help output from growfs.c and mkfs.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         82720
>Category:       bin
>Synopsis:       [patch] Incorrect help output from growfs.c and mkfs.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    brueffer
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 28 05:50:13 GMT 2005
>Closed-Date:    Sun Feb 16 11:29:28 CET 2014
>Last-Modified:  Sun Feb 16 10:30:00 UTC 2014
>Originator:     David D.W. Downey
>Release:        FreeBSD 5.4-RELEASE-p1 i386
>Organization:
<CyberSpace Technologies>
>Environment:
System: FreeBSD www.pgpkeys.us 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #0: Sun Jun 26 08:14:43 EDT 2005 root@www.pgpkeys.us:/usr/obj/usr/src/sys/PGPNET i386

Duron 1.3GHz + 1GB DDR266 RAM

>Description:
	newfs -N incorrectly states that, when passing superblocks for filesystem repair, fsck -b is the action for specifying the superblock to repair a filesystem as shown by the following output.

OUTPUT
-------
/dev/ad0s1a: 9000.0MB (18432000 sectors) block size 16384, fragment size 2048
        using 49 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
<snip>

-----------
END OUTPUT

The correct information is 'fsck_ffs -b #' for specifying this information. I have submitted 2 patches to repair the 2 files involved with displaying this incorrect information. The files involved are /usr/src/sbin/growfs/growfs.c and /usr/src/sbin/newfs/mkfs.c


>How-To-Repeat:
	log in as uid 0 and run 'newfs -N /dev/<SomeMountDevice>'
>Fix:

	Apply the patches below.
	Commit changes.

--- growfs.c-062820050018 begins here ---
--- growfs.c	Thu Jul 29 07:28:24 2004
+++ growfs.c-fixed	Tue Jun 28 00:17:48 2005
@@ -252,7 +252,7 @@
 	 * Now build the cylinders group blocks and
 	 * then print out indices of cylinder groups.
 	 */
-	printf("super-block backups (for fsck -b #) at:\n");
+	printf("super-block backups (for fsck_ffs -b #) at:\n");
 	i = 0;
 	width = charsperline();
 
--- growfs.c-062820050018 ends here ---

--- mkfs.c-062820050021 begins here ---
--- mkfs.c	Tue Mar  1 00:30:30 2005
+++ mkfs.c-fixed	Tue Jun 28 00:20:41 2005
@@ -477,7 +477,7 @@
 	 * Now build the cylinders group blocks and
 	 * then print out indices of cylinder groups.
 	 */
-	printf("super-block backups (for fsck -b #) at:\n");
+	printf("super-block backups (for fsck_ffs -b #) at:\n");
 	i = 0;
 	width = charsperline();
 	/*
--- mkfs.c-062820050021 ends here ---


>Release-Note:
>Audit-Trail:

From: "David D.W. Downey" <pgpkeys@pgpkeys.net>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: bin/82720: <[patch] Incorrect help output from growfs.c and mkfs.c>
Date: Tue, 28 Jun 2005 04:02:27 -0400

 For the record,
 
 My rationale behind setting the Priority to serious is that if you do not
 know about fsck_ffs (which can be expected since the default and most known
 tool is fsck) then you will run into the issue of not knowing what to do to
 repair the broken system.
 
 Case in point, I ran into this problem when a -CURRENT system was unable to
 repair the default superblock. It kept spitting out FREE BLOK COUNT(S) WRONG
 IN SUPERBLOCK. SALVAGE? [no]. Needless to say I spent probably 45 minutes
 digging through the man pages such as fsck, bread, sbread, sbwrite, several
 lib pages, et cetera trying to figure out how to find info about the next
 superblock in order to fix the situation.
 
 Now I'm just one person. Think of the affect on say just 5,000 people
 worldwide with this issue, finally finding newfs only to find out the
 information it gives is incorrect. Now add in the fact there's no mention of
 fsck_ffs which _is_ the right tool to fix the SB using the SB info spit out
 by newfs. There's no logical connection to the correct tool, leaving people
 stranded. Small item, this patch, but big help for administrative flow and
 repair.
 
 --
 David D.W. Downey
 
 
 

From: Bruce Evans <bde@zeta.org.au>
To: "David D.W. Downey" <pgpkeys@pgpkeys.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/82720: <[patch] Incorrect help output from growfs.c and
 mkfs.c>
Date: Tue, 28 Jun 2005 21:09:11 +1000 (EST)

 On Tue, 28 Jun 2005, David D.W. Downey wrote:
 
 > My rationale behind setting the Priority to serious is that if you do not
 > know about fsck_ffs (which can be expected since the default and most known
 > tool is fsck) then you will run into the issue of not knowing what to do to
 > repair the broken system.
 
 The bug was introduced when the old fsck was renamed to fsck_ffs and fsck
 became a different program (a wrapper that selects a file-system-specific
 fscks).  This PR shows that the wrapper doesn't handle options very well.
 
 > Case in point, I ran into this problem when a -CURRENT system was unable to
 > repair the default superblock. It kept spitting out FREE BLOK COUNT(S) WRONG
 > IN SUPERBLOCK. SALVAGE? [no]. Needless to say I spent probably 45 minutes
 > digging through the man pages such as fsck, bread, sbread, sbwrite, several
 > lib pages, et cetera trying to figure out how to find info about the next
 > superblock in order to fix the situation.
 
 It actually is described in fsck(8).  The -T option can be used to pass
 flags to file-system-specific fscks.  This works like the -o option for
 mount(8) except it is much more general despite less need for generality,
 and thus is much harder to use: for mount, where you would say
 
      mount -t <fstype1,...> -o <options>
 
 and have all (?) options passed to the mount utility for each selected
 fstype whether you want this or not, for fsck you can say
 
      mount -T<fstype1>:<options for fstype1> -T<fstype2>:<opts2> ...
 
 You can also say
 
      fsck -t <fstype1,...>
 
 but there is nothing corresponding to mount -o for fsck.  (Note that
 multiple fstypes are sometimes useful although not for fsck -b, erm
 fsck_ffs -b, since they can be used to select a subset of all file
 systems in /etc/fstab for mount -a and fsck <default>.)
 
 > Now I'm just one person. Think of the affect on say just 5,000 people
 > worldwide with this issue, finally finding newfs only to find out the
 > information it gives is incorrect. Now add in the fact there's no mention of
 > fsck_ffs which _is_ the right tool to fix the SB using the SB info spit out
 > by newfs. There's no logical connection to the correct tool, leaving people
 > stranded. Small item, this patch, but big help for administrative flow and
 > repair.
 
 I think the "right" tool is still fsck (with -T).  However, this is
 even harder to use than might first appear.  Where for "mount -t" the
 fstype to use is the actual kernel fstype whose mispelling for the
 ffs file system is well known, the fstype for "fsck -T" is the one
 in the disk label for the partition (if any (*)).  "ffs" is misspelled
 "ufs" in the kernel, so to mount(8) an ffs file system, you say
 "mount -t ufs ...".  (Similarly for other utilities that use
 getvfsbyname(3), e.g., "find -t ufs".) For fsck, the the spelling of the
 file system is normally (*) taken from the disk label, and the "ffs" is
 usually mispelled "4.2BSD" there, so you have to say something like
 "fsck -T4.2BSD:..." to run fsck on ffs file systems and pass options.
 (fsck does some simple transformations of the typename, so you can also 
 say "fsck -T4.2bsd:...", but fsck doesn't have a dictionary of misspellings
 so neither the "ffs" nor its usual misspelling are transformed to or from
 "4.2BSD".)  For passing the -b option, quoting is probably needed, so the
 "right" way ends up as something like:
 
      fsck -T4.2BSD:"-b 64"
 
 Ugh.  It's easier to describe and use the method in your patch.
 
 (*) The fsck wrapper also fails if there is no disk label or other metadata
 to give the fstype.  In such cases, I don't know how to make it exec the
 file-system-specific fsck so I just use the f-s-s fsck directly.
 
 Anyway, perhaps your PR should be changed/enlarged to one about unclear
 documentation in fsck.8.
 
 Bruce

From: "David D.W. Downey" <pgpkeys@pgpkeys.net>
To: <bug-followup@FreeBSD.org>,
	<pgpkeys@pgpnet.us>
Cc:  
Subject: Re: bin/82720: <[patch] Incorrect help output from growfs.c and mkfs.c>
Date: Tue, 28 Jun 2005 11:14:18 -0400

 Bruce,
 
 Thanks for responding. OK, I'm extremely new to patch submission (as you can
 probably tell from the couple of goofs I made in the original submission).
 
 How would you like to see this best split out? Just name it, and it's done.
 
 I was thinking since it covers both growfs and newfs, as shown by the 2
 separate patches, that I needed to submit against both of those. Also, as
 you mentioned, because it involved fsck and fsck_fss that the 'bug' might
 need to be crossfiled against those as well.
 
 
 --
 David D.W. Downey
 
 
 

From: Bruce Evans <bde@zeta.org.au>
To: "David D.W. Downey" <pgpkeys@pgpkeys.net>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/82720: <[patch] Incorrect help output from growfs.c and
 mkfs.c>
Date: Wed, 6 Jul 2005 04:27:16 +1000 (EST)

 On Tue, 28 Jun 2005, David D.W. Downey wrote:
 
 > Thanks for responding. OK, I'm extremely new to patch submission (as you can
 > probably tell from the couple of goofs I made in the original submission).
 >
 > How would you like to see this best split out? Just name it, and it's done.
 >
 > I was thinking since it covers both growfs and newfs, as shown by the 2
 > separate patches, that I needed to submit against both of those. Also, as
 > you mentioned, because it involved fsck and fsck_fss that the 'bug' might
 > need to be crossfiled against those as well.
 
 Decide if you want to give an example of how to do this in the fsck man
 page.  The example might say to use fsck_ffs directly since that is simpler.
 Then change the utilities to use the same example.
 
 Bruce

From: "David D.W. Downey" <pgpkeys@pgpkeys.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/82720: <[patch] Incorrect help output from growfs.c and mkfs.c>
Date: Fri, 05 Aug 2005 17:57:39 -0400

  > Decide if you want to give an example of how to do this in the fsck
  > man page.  The example might say to use fsck_ffs directly since that
  > is simpler. Then change the utilities to use the same example.
  >
  > Bruce
 
 Hey Bruce,
 
 I'm willing to submit a patch with the proper examples for both pages, 
 where do you want me to send it? Or is this a dead issue?
 
 --
 David
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/82720: commit references a PR
Date: Sat, 23 Jun 2012 19:46:19 +0000 (UTC)

 Author: trasz
 Date: Sat Jun 23 19:46:07 2012
 New Revision: 237505
 URL: http://svn.freebsd.org/changeset/base/237505
 
 Log:
   Make newfs(8) display "super-block backups (for fsck_ffs -b #)" instead
   of super-block backups (for fsck -b #), since fsck(8) doesn't accept
   the "-b" option; only fsck_ffs(8) does.
   
   PR:		bin/82720
   MFC after:	1 week
 
 Modified:
   stable/9/sbin/newfs/mkfs.c
 
 Modified: stable/9/sbin/newfs/mkfs.c
 ==============================================================================
 --- stable/9/sbin/newfs/mkfs.c	Sat Jun 23 19:42:06 2012	(r237504)
 +++ stable/9/sbin/newfs/mkfs.c	Sat Jun 23 19:46:07 2012	(r237505)
 @@ -539,7 +539,7 @@ restart:
  	 * Now build the cylinders group blocks and
  	 * then print out indices of cylinder groups.
  	 */
 -	printf("super-block backups (for fsck -b #) at:\n");
 +	printf("super-block backups (for fsck_ffs -b #) at:\n");
  	i = 0;
  	width = charsperline();
  	/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: brueffer 
State-Changed-When: Sun Feb 9 15:29:11 CET 2014 
State-Changed-Why:  
This change was accidently committed directly to 9-STABLE in r237505 
(and only half).  I just applied both of the patches directly to HEAD 
and will merge them to the STABLE branches. 

Thanks for the submission and sorry for the long waiting time! 


Responsible-Changed-From-To: freebsd-bugs->brueffer 
Responsible-Changed-By: brueffer 
Responsible-Changed-When: Sun Feb 9 15:29:11 CET 2014 
Responsible-Changed-Why:  
MFC reminder. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/82720: commit references a PR
Date: Sun,  9 Feb 2014 14:29:00 +0000 (UTC)

 Author: brueffer
 Date: Sun Feb  9 14:28:47 2014
 New Revision: 261655
 URL: http://svnweb.freebsd.org/changeset/base/261655
 
 Log:
   Refer newfs and growfs users to fsck_ffs instead of
   fsck, the latter does not accept the referred to "-b" flag.
   
   This change was accidently committed directly to 9-STABLE in
   r237505.
   
   PR:		82720
   Submitted by:	David D.W. Downey
   MFC after:	1 week
 
 Modified:
   head/sbin/growfs/growfs.c
   head/sbin/newfs/mkfs.c
 
 Modified: head/sbin/growfs/growfs.c
 ==============================================================================
 --- head/sbin/growfs/growfs.c	Sun Feb  9 14:02:39 2014	(r261654)
 +++ head/sbin/growfs/growfs.c	Sun Feb  9 14:28:47 2014	(r261655)
 @@ -201,7 +201,7 @@ growfs(int fsi, int fso, unsigned int Nf
  	 * Now build the cylinders group blocks and
  	 * then print out indices of cylinder groups.
  	 */
 -	printf("super-block backups (for fsck -b #) at:\n");
 +	printf("super-block backups (for fsck_ffs -b #) at:\n");
  	i = 0;
  	width = charsperline();
  
 
 Modified: head/sbin/newfs/mkfs.c
 ==============================================================================
 --- head/sbin/newfs/mkfs.c	Sun Feb  9 14:02:39 2014	(r261654)
 +++ head/sbin/newfs/mkfs.c	Sun Feb  9 14:28:47 2014	(r261655)
 @@ -544,7 +544,7 @@ restart:
  	 * Now build the cylinders group blocks and
  	 * then print out indices of cylinder groups.
  	 */
 -	printf("super-block backups (for fsck -b #) at:\n");
 +	printf("super-block backups (for fsck_ffs -b #) at:\n");
  	i = 0;
  	width = charsperline();
  	/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/82720: commit references a PR
Date: Sun, 16 Feb 2014 10:16:14 +0000 (UTC)

 Author: brueffer
 Date: Sun Feb 16 10:16:07 2014
 New Revision: 261963
 URL: http://svnweb.freebsd.org/changeset/base/261963
 
 Log:
   Refer newfs and growfs users to fsck_ffs instead of
   fsck, the latter does not accept the referred to "-b" flag.
   
   PR:		82720
   Submitted by:	David D.W. Downey
 
 Modified:
   stable/10/sbin/growfs/growfs.c
   stable/10/sbin/newfs/mkfs.c
 Directory Properties:
   stable/10/   (props changed)
 
 Modified: stable/10/sbin/growfs/growfs.c
 ==============================================================================
 --- stable/10/sbin/growfs/growfs.c	Sun Feb 16 08:42:52 2014	(r261962)
 +++ stable/10/sbin/growfs/growfs.c	Sun Feb 16 10:16:07 2014	(r261963)
 @@ -201,7 +201,7 @@ growfs(int fsi, int fso, unsigned int Nf
  	 * Now build the cylinders group blocks and
  	 * then print out indices of cylinder groups.
  	 */
 -	printf("super-block backups (for fsck -b #) at:\n");
 +	printf("super-block backups (for fsck_ffs -b #) at:\n");
  	i = 0;
  	width = charsperline();
  
 
 Modified: stable/10/sbin/newfs/mkfs.c
 ==============================================================================
 --- stable/10/sbin/newfs/mkfs.c	Sun Feb 16 08:42:52 2014	(r261962)
 +++ stable/10/sbin/newfs/mkfs.c	Sun Feb 16 10:16:07 2014	(r261963)
 @@ -546,7 +546,7 @@ restart:
  	 * Now build the cylinders group blocks and
  	 * then print out indices of cylinder groups.
  	 */
 -	printf("super-block backups (for fsck -b #) at:\n");
 +	printf("super-block backups (for fsck_ffs -b #) at:\n");
  	i = 0;
  	width = charsperline();
  	/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: brueffer 
State-Changed-When: Sun Feb 16 11:28:58 CET 2014 
State-Changed-Why:  
Merged to the stable branches.  Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/82720: commit references a PR
Date: Sun, 16 Feb 2014 10:28:25 +0000 (UTC)

 Author: brueffer
 Date: Sun Feb 16 10:28:18 2014
 New Revision: 261964
 URL: http://svnweb.freebsd.org/changeset/base/261964
 
 Log:
   MFC: r261655
   
   Refer newfs and growfs users to fsck_ffs instead of
   fsck, the latter does not accept the referred to "-b" flag.
   
   The part of the change pertaining newfs has already been merged
   to stable/9 in r237505, so only record that part of the merge.
   
   PR:		82720
   Submitted by:	David D.W. Downey
 
 Modified:
   stable/9/sbin/growfs/growfs.c
 Directory Properties:
   stable/9/sbin/growfs/   (props changed)
   stable/9/sbin/newfs/   (props changed)
 
 Modified: stable/9/sbin/growfs/growfs.c
 ==============================================================================
 --- stable/9/sbin/growfs/growfs.c	Sun Feb 16 10:16:07 2014	(r261963)
 +++ stable/9/sbin/growfs/growfs.c	Sun Feb 16 10:28:18 2014	(r261964)
 @@ -206,7 +206,7 @@ growfs(int fsi, int fso, unsigned int Nf
  	 * Now build the cylinders group blocks and
  	 * then print out indices of cylinder groups.
  	 */
 -	printf("super-block backups (for fsck -b #) at:\n");
 +	printf("super-block backups (for fsck_ffs -b #) at:\n");
  	i = 0;
  	width = charsperline();
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
