From swear@attbi.com  Wed Jan  1 12:56:38 2003
Return-Path: <swear@attbi.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3567B37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Jan 2003 12:56:38 -0800 (PST)
Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C618A43EA9
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Jan 2003 12:56:37 -0800 (PST)
	(envelope-from swear@attbi.com)
Received: from localhost.localdomain (<unknown.domain>[12.242.158.67])
          by rwcrmhc51.attbi.com (rwcrmhc51) with ESMTP
          id <20030101205637051006jnf6e>; Wed, 1 Jan 2003 20:56:37 +0000
Received: from localhost.localdomain (localhost [127.0.0.1])
	by localhost.localdomain (8.12.6/8.12.6) with ESMTP id h01Kwx8S019780
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 1 Jan 2003 12:59:05 -0800 (PST)
	(envelope-from swear@attbi.com)
Received: (from jojo@localhost)
	by localhost.localdomain (8.12.6/8.12.6/Submit) id h01Kvc9M019763;
	Wed, 1 Jan 2003 12:57:39 -0800 (PST)
	(envelope-from swear@attbi.com)
Message-Id: <cshecs1tbx.ecs@localhost.localdomain>
Date: 01 Jan 2003 12:57:38 -0800
From: "Gary W. Swearingen" <swear@attbi.com>
Reply-To: swear@attbi.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: dump(8) program gives unnecessary -L warning
X-GNATS-Notify:

>Number:         46672
>Category:       bin
>Synopsis:       dump(8) program gives unnecessary -L warning
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 01 13:00:14 PST 2003
>Closed-Date:    Mon Apr 12 13:17:10 PDT 2004
>Last-Modified:  Mon Apr 12 13:17:10 PDT 2004
>Originator:     Gary W. Swearingen
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
none
>Environment:
FreeBSD localhost.localdomain 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Mon Dec 30 17:04:36 PST 2002     root@localhost.localdomain:/usr/obj/usr/src/sys/GENERIC  i386
================
>Description:

The dump(8) program, when used on a filesystem mounted with "-r",
warns:  "WARNING: should use -L when dumping live filesysterms!"

1) AFAIK, there's no good reason to use "-L" when dumping a read-only
filesystem.  The program should check for read-only filesystem status
and omit the warning in that case.

2) The techno-grammar in the warning is unnecessary.  Change it to
"WARNING: Use -L when dumping live filesysterms!" (my favorite) or
"WARNING: -L should be used when dumping live filesysterms!"  or
"WARNING: One should use -L when dumping live filesysterms!".

================
>How-To-Repeat:
n/a
================
>Fix:
>Release-Note:
>Audit-Trail:

From: Ceri Davies <setantae@submonkey.net>
To: "Gary W. Swearingen" <swear@attbi.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/46672: dump(8) program gives unnecessary -L warning
Date: Wed, 1 Jan 2003 21:01:45 +0000

 On Wed, Jan 01, 2003 at 12:57:38PM -0800, Gary W. Swearingen wrote:
 > 
 > 2) The techno-grammar in the warning is unnecessary.  Change it to
 > "WARNING: Use -L when dumping live filesysterms!" (my favorite) or
 > "WARNING: -L should be used when dumping live filesysterms!"  or
 > "WARNING: One should use -L when dumping live filesysterms!".
 
 And spell "systems" right too ;)
 
 Ceri

From: "Jason Young" <jyoung8607@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org, swear@attbi.com
Cc:  
Subject: Re: bin/46672: dump(8) program gives unnecessary -L warning
Date: Tue, 02 Sep 2003 02:07:09 -0500

 Here is a patch to dump(8) that eliminates the warning for filesystems 
 mounted readonly, and modifies the warning to include only read-write 
 filesystems.
 
 
 *** main.c.orig Tue Sep  2 01:26:49 2003
 --- main.c      Tue Sep  2 01:59:09 2003
 ***************
 *** 311,324 ****
         }
         spcl.c_dev[NAMELEN-1]='\0';
         spcl.c_filesys[NAMELEN-1]='\0';
 
         if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
 !               if (snapdump == 0) {
 !                       msg("WARNING: %s\n",
 !                           "should use -L when dumping live filesystems!");
 !               } else {
                         struct ufs_args args;
                         char snapname[BUFSIZ];
 
                         snprintf(snapname, sizeof snapname, 
 "%s/.dump_snapshot",
                             mntpt);
 --- 311,321 ----
         }
         spcl.c_dev[NAMELEN-1]='\0';
         spcl.c_filesys[NAMELEN-1]='\0';
 
         if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
 !               if (snapdump == 1) {
                         struct ufs_args args;
                         char snapname[BUFSIZ];
 
                         snprintf(snapname, sizeof snapname, 
 "%s/.dump_snapshot",
                             mntpt);
 ***************
 *** 338,347 ****
 --- 335,347 ----
                         }
                         unlink(snapname);
                         if (fstat(diskfd, &sb) != 0)
                                 err(X_STARTUP, "%s: stat", snapname);
                         spcl.c_date = _time_to_time64(sb.st_mtime);
 +               } else if(!(mntflags & MNT_RDONLY)) {
 +                       msg("WARNING: %s\n",
 +                             "should use -L when dumping live r/w 
 filesystems!");
                 }
         } else if (snapdump != 0) {
                 msg("WARNING: Cannot use -L on an unmounted filesystem.\n");
                 snapdump = 0;
         }
 
 _________________________________________________________________
 Get MSN 8 and enjoy automatic e-mail virus protection.    
 http://join.msn.com/?page=features/virus
 

From: "Jason Young" <jyoung8607@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org, swear@attbi.com
Cc:  
Subject: Re: bin/46672: dump(8) program gives unnecessary -L warning
Date: Tue, 02 Sep 2003 02:58:54 -0500

 A better patch: improve error handling, and update documentation.
 
 *** main.c      Tue Sep  2 02:48:03 2003
 --- main.c.orig Tue Sep  2 01:26:49 2003
 ***************
 *** 311,330 ****
         }
         spcl.c_dev[NAMELEN-1]='\0';
         spcl.c_filesys[NAMELEN-1]='\0';
 
         if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
 !               if (mntflags & MNT_RDONLY) {
 !                       if(snapdump == 1) {
 !                               msg("WARNING: %s\n",
 !                                   "-L ignored for read-only filesystem.");
 !                               snapdump = 0;
 !                       }
 !               }
 !               else if (snapdump == 0) {
                         msg("WARNING: %s\n",
 !                           "should use -L when dumping live r/w 
 filesystems!");
                 } else {
                         struct ufs_args args;
                         char snapname[BUFSIZ];
 
                         snprintf(snapname, sizeof snapname, 
 "%s/.dump_snapshot",
 --- 311,323 ----
         }
         spcl.c_dev[NAMELEN-1]='\0';
         spcl.c_filesys[NAMELEN-1]='\0';
 
         if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
 !               if (snapdump == 0) {
                         msg("WARNING: %s\n",
 !                           "should use -L when dumping live filesystems!");
                 } else {
                         struct ufs_args args;
                         char snapname[BUFSIZ];
 
                         snprintf(snapname, sizeof snapname, 
 "%s/.dump_snapshot",
 fury#
 
 
 *** dump.8.orig Tue Sep  2 02:12:53 2003
 --- dump.8      Tue Sep  2 02:54:39 2003
 ***************
 *** 211,220 ****
 --- 211,222 ----
   To obtain a consistent dump image,
   .Nm
   takes a snapshot of the file system and
   then does a dump of the snapshot.
   The snapshot is removed when the dump is complete.
 + This option is disregarded for unmounted or read-only
 + mounted filesystems.
   .It Fl n
   Whenever
   .Nm
   requires operator attention,
   notify all operators in the group
 
 _________________________________________________________________
 MSN 8: Get 6 months for $9.95/month. http://join.msn.com/?page=dept/dialup
 
State-Changed-From-To: open->closed 
State-Changed-By: green 
State-Changed-When: Mon Apr 12 13:04:17 PDT 2004 
State-Changed-Why:  
Committed to -CURRENT; thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46672 
>Unformatted:
