Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2003 00:10:16 -0700 (PDT)
From:      "Jason Young" <jyoung8607@hotmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/46672: dump(8) program gives unnecessary -L warning
Message-ID:  <200309020710.h827AGGw078125@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/46672; it has been noted by GNATS.

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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309020710.h827AGGw078125>