CVS commit: src/sbin/dump
Module Name:src Committed By: mrg Date: Mon Aug 7 23:26:40 UTC 2023 Modified Files: src/sbin/dump: traverse.c Log Message: fix always true conditional by removing the address-of operator. found by GCC 12. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sbin/dump/traverse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/traverse.c diff -u src/sbin/dump/traverse.c:1.55 src/sbin/dump/traverse.c:1.56 --- src/sbin/dump/traverse.c:1.55 Wed Jan 26 20:22:14 2022 +++ src/sbin/dump/traverse.c Mon Aug 7 23:26:40 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: traverse.c,v 1.55 2022/01/26 20:22:14 christos Exp $ */ +/* $NetBSD: traverse.c,v 1.56 2023/08/07 23:26:40 mrg Exp $ */ /*- * Copyright (c) 1980, 1988, 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)traverse.c 8.7 (Berkeley) 6/15/95"; #else -__RCSID("$NetBSD: traverse.c,v 1.55 2022/01/26 20:22:14 christos Exp $"); +__RCSID("$NetBSD: traverse.c,v 1.56 2023/08/07 23:26:40 mrg Exp $"); #endif #endif /* not lint */ @@ -780,7 +780,7 @@ appendextdata(union dinode *dp) tbperdb = ufsib->ufs_bsize >> tp_bshift; assert(count + blks < TP_NINDIR); for (i = 0; i < blks; i++) - if (&dp->dp2.di_extb[i / tbperdb] != 0) + if (dp->dp2.di_extb[i / tbperdb] != 0) spcl.c_addr[count + i] = 1; else spcl.c_addr[count + i] = 0;
CVS commit: src/sbin/dump
Module Name:src Committed By: mrg Date: Mon Aug 7 23:26:40 UTC 2023 Modified Files: src/sbin/dump: traverse.c Log Message: fix always true conditional by removing the address-of operator. found by GCC 12. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sbin/dump/traverse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/dump
Module Name:src Committed By: mlelstv Date: Mon Mar 14 18:38:11 UTC 2022 Modified Files: src/sbin/dump: optr.c Log Message: Silently ignore fstab entries with NAME= entries that cannot be resolved. Fixes PR 56249. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sbin/dump/optr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/optr.c diff -u src/sbin/dump/optr.c:1.43 src/sbin/dump/optr.c:1.44 --- src/sbin/dump/optr.c:1.43 Fri Mar 1 16:42:11 2019 +++ src/sbin/dump/optr.c Mon Mar 14 18:38:11 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: optr.c,v 1.43 2019/03/01 16:42:11 christos Exp $ */ +/* $NetBSD: optr.c,v 1.44 2022/03/14 18:38:11 mlelstv Exp $ */ /*- * Copyright (c) 1980, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; #else -__RCSID("$NetBSD: optr.c,v 1.43 2019/03/01 16:42:11 christos Exp $"); +__RCSID("$NetBSD: optr.c,v 1.44 2022/03/14 18:38:11 mlelstv Exp $"); #endif #endif /* not lint */ @@ -344,9 +344,10 @@ allocfsent(const struct fstab *fs) new->fs_file = xstrdup(fs->fs_file); new->fs_type = xstrdup(fs->fs_type); new->fs_spec = xmalloc(FILENAME_MAX); - if (getfsspecname(new->fs_spec, FILENAME_MAX, fs->fs_spec) == NULL) - quite(errno, "can't resolve mount point %s (%s)", - fs->fs_spec, new->fs_spec); + if (getfsspecname(new->fs_spec, FILENAME_MAX, fs->fs_spec) == NULL) { + free(new); + return NULL; + } new->fs_passno = fs->fs_passno; new->fs_freq = fs->fs_freq; return new; @@ -384,6 +385,9 @@ getfstab(void) continue; #endif fs = allocfsent(fs); + if (fs == NULL) + continue; + pf = (struct pfstab *)xmalloc(sizeof (*pf)); pf->pf_fstab = fs; SLIST_INSERT_HEAD(&table, pf, pf_list);
CVS commit: src/sbin/dump
Module Name:src Committed By: mlelstv Date: Mon Mar 14 18:38:11 UTC 2022 Modified Files: src/sbin/dump: optr.c Log Message: Silently ignore fstab entries with NAME= entries that cannot be resolved. Fixes PR 56249. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sbin/dump/optr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/dump
Module Name:src Committed By: christos Date: Wed Jan 26 20:22:14 UTC 2022 Modified Files: src/sbin/dump: traverse.c Log Message: PR/56643: Paul Goyette: Disable the last block adjustment for now. It seems to break restore. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sbin/dump/traverse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/traverse.c diff -u src/sbin/dump/traverse.c:1.54 src/sbin/dump/traverse.c:1.55 --- src/sbin/dump/traverse.c:1.54 Wed Jul 7 07:06:37 2021 +++ src/sbin/dump/traverse.c Wed Jan 26 15:22:14 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: traverse.c,v 1.54 2021/07/07 11:06:37 christos Exp $ */ +/* $NetBSD: traverse.c,v 1.55 2022/01/26 20:22:14 christos Exp $ */ /*- * Copyright (c) 1980, 1988, 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)traverse.c 8.7 (Berkeley) 6/15/95"; #else -__RCSID("$NetBSD: traverse.c,v 1.54 2021/07/07 11:06:37 christos Exp $"); +__RCSID("$NetBSD: traverse.c,v 1.55 2022/01/26 20:22:14 christos Exp $"); #endif #endif /* not lint */ @@ -691,6 +691,7 @@ blksout64(union dinode *dp, int64_t *blk static int writingextdata = 0; blks = howmany(frags * ufsib->ufs_fsize, TP_BSIZE); +#if 0 if (last) { int resid; int extsize = iswap32(spcl.c_extsize); @@ -703,6 +704,7 @@ blksout64(union dinode *dp, int64_t *blk if (resid > 0) blks -= howmany(ufsib->ufs_fsize, TP_BSIZE) - resid; } +#endif tbperdb = ufsib->ufs_bsize >> tp_bshift; for (i = 0; i < blks; i += TP_NINDIR) { if (i + TP_NINDIR > blks)
CVS commit: src/sbin/dump
Module Name:src Committed By: christos Date: Wed Jan 26 20:22:14 UTC 2022 Modified Files: src/sbin/dump: traverse.c Log Message: PR/56643: Paul Goyette: Disable the last block adjustment for now. It seems to break restore. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sbin/dump/traverse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/dump
Module Name:src Committed By: perseant Date: Mon Aug 19 18:12:50 UTC 2019 Modified Files: src/sbin/dump: dump.8 main.c Log Message: Add -D flag to allow the user to specify an alternate dumpdates file. Closes PR #54469. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sbin/dump/dump.8 cvs rdiff -u -r1.75 -r1.76 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/dump
Module Name:src Committed By: perseant Date: Mon Aug 19 18:12:50 UTC 2019 Modified Files: src/sbin/dump: dump.8 main.c Log Message: Add -D flag to allow the user to specify an alternate dumpdates file. Closes PR #54469. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sbin/dump/dump.8 cvs rdiff -u -r1.75 -r1.76 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/dump.8 diff -u src/sbin/dump/dump.8:1.71 src/sbin/dump/dump.8:1.72 --- src/sbin/dump/dump.8:1.71 Mon Mar 25 07:03:17 2019 +++ src/sbin/dump/dump.8 Mon Aug 19 18:12:50 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: dump.8,v 1.71 2019/03/25 07:03:17 wiz Exp $ +.\" $NetBSD: dump.8,v 1.72 2019/08/19 18:12:50 perseant Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" Regents of the University of California. @@ -42,6 +42,7 @@ .Op Fl 0123456789aceFinStuX .Op Fl B Ar records .Op Fl b Ar blocksize +.Op Fl D Ar dumpdates-file .Op Fl d Ar density .Op Fl f Ar file .Op Fl h Ar level @@ -145,6 +146,9 @@ The number of kilobytes per dump record. .It Fl c Modify the calculation of the default density and tape size to be more appropriate for cartridge tapes. +.It Fl D Ar dumpdates-file +Use the given file as a record of dump dates instead of +.Pa /etc/dumpdates . .It Fl d Ar density Set tape density to .Ar density . Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.75 src/sbin/dump/main.c:1.76 --- src/sbin/dump/main.c:1.75 Mon Mar 25 02:13:01 2019 +++ src/sbin/dump/main.c Mon Aug 19 18:12:50 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $ */ +/* $NetBSD: main.c,v 1.76 2019/08/19 18:12:50 perseant Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $"); +__RCSID("$NetBSD: main.c,v 1.76 2019/08/19 18:12:50 perseant Exp $"); #endif #endif /* not lint */ @@ -133,7 +133,7 @@ main(int argc, char *argv[]) obsolete(&argc, &argv); while ((ch = getopt(argc, argv, - "0123456789aB:b:cd:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1) + "0123456789aB:b:cd:D:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1) switch (ch) { /* dump level */ case '0': case '1': case '2': case '3': case '4': @@ -164,6 +164,10 @@ main(int argc, char *argv[]) ntrec = HIGHDENSITYTREC; break; + case 'D': /* specify alt. dumpdates file */ + dumpdates = optarg; + break; + case 'e': /* eject full tapes */ eflag = 1; break;
Re: CVS commit: src/sbin/dump
> On Mar 1, 2019, at 9:43 PM, Robert Elz wrote: > >Date:Fri, 1 Mar 2019 11:42:11 -0500 >From:"Christos Zoulas" >Message-ID: <20190301164211.de6aaf...@cvs.netbsd.org> > > | Use getfsspecname() to fill the filesystem argument in dumpdates. > > Is there a reason for that?It seems like a step backwards to me. > > If I follow what that means correctly, it is inserting /dev/dkN in > dumpdates, instead of NAME=foo ? > > That's about the least desirable outcome possible - dumpdates is used > to remember when the various dump levels have been done for a filesystem. > The wedge that happens to have been used when the last dump of a filesystem > was done is nowhere near stable enough to be useful for that purpose. > > That is, I dump /home which is on dk6 today. Tomorrow, after a > reboot, /home is now on dk5 (the tumb drive wasn't plugged in at > bopot time, or something) and I want to do an incremental dump. > > The dumpdates record of what and when dk5 was last dumped will have > nothing to do with the dump I did of /home yesterday. > > We ought probably be keying dumpdates on a GUID for the filesystem, > but we don't really have those (we should) - the closest we come, which > is almost good enough, is the GUID for the device on which the filesystem > is stored - and we don't always have that either. I agree with all of that, but all this patch does is:: Before: $ dump -W Last dump(s) done (Dump '>' file systems): > /dev/rdk12( ) Last dump: Level 3, Date Wed Feb 27 09:16 2019 After: $ dump -W Last dump(s) done (Dump '>' file systems): > /dev/rdk12(/u) Last dump: Level 3, Date Wed Feb 27 09:16 2019 If it does not work properly and it breaks something else, I will revert it. christos > kre > > ps: note that all I have looked at (so far) related to this has been > the diffs for your commit, but this is something it has been my intent > to eventually work on for ages.Another thing that needs fixing is > to allow multiple dumpdates files, so there can be several indepenendent > dump sequences happening in parallel (I don't mean at the same instant, > but that I do a level 0 today in set A, tomorrow I do a level 0 in set B, > then the day after I do an incremental based upon today's level 0 (set A), > then an incremental based upon tomorrows the next day (set B), and alternate > between the two, so I have two separate sets of dumps (usually each one > to a different external drive) where it alternates day to day which one is > most up to date. I currently manage that by simply copying the dumpdates > file I want to use to /etc/dumpdates before I start, then copying it back > again when finished, but that's not an ideal solution.
Re: CVS commit: src/sbin/dump
Date:Fri, 1 Mar 2019 11:42:11 -0500 From:"Christos Zoulas" Message-ID: <20190301164211.de6aaf...@cvs.netbsd.org> | Use getfsspecname() to fill the filesystem argument in dumpdates. Is there a reason for that?It seems like a step backwards to me. If I follow what that means correctly, it is inserting /dev/dkN in dumpdates, instead of NAME=foo ? That's about the least desirable outcome possible - dumpdates is used to remember when the various dump levels have been done for a filesystem. The wedge that happens to have been used when the last dump of a filesystem was done is nowhere near stable enough to be useful for that purpose. That is, I dump /home which is on dk6 today. Tomorrow, after a reboot, /home is now on dk5 (the tumb drive wasn't plugged in at bopot time, or something) and I want to do an incremental dump. The dumpdates record of what and when dk5 was last dumped will have nothing to do with the dump I did of /home yesterday. We ought probably be keying dumpdates on a GUID for the filesystem, but we don't really have those (we should) - the closest we come, which is almost good enough, is the GUID for the device on which the filesystem is stored - and we don't always have that either. kre ps: note that all I have looked at (so far) related to this has been the diffs for your commit, but this is something it has been my intent to eventually work on for ages.Another thing that needs fixing is to allow multiple dumpdates files, so there can be several indepenendent dump sequences happening in parallel (I don't mean at the same instant, but that I do a level 0 today in set A, tomorrow I do a level 0 in set B, then the day after I do an incremental based upon today's level 0 (set A), then an incremental based upon tomorrows the next day (set B), and alternate between the two, so I have two separate sets of dumps (usually each one to a different external drive) where it alternates day to day which one is most up to date. I currently manage that by simply copying the dumpdates file I want to use to /etc/dumpdates before I start, then copying it back again when finished, but that's not an ideal solution.
CVS commit: src/sbin/dump
Module Name:src Committed By: christos Date: Thu Mar 11 01:32:59 UTC 2010 Modified Files: src/sbin/dump: itime.c main.c Log Message: PR/42952: The Grey Wolf: Fix for "true incremental". Don't overload level 9, use a new level "i" which is logically 10. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sbin/dump/itime.c cvs rdiff -u -r1.65 -r1.66 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/itime.c diff -u src/sbin/dump/itime.c:1.17 src/sbin/dump/itime.c:1.18 --- src/sbin/dump/itime.c:1.17 Thu Feb 25 21:11:40 2010 +++ src/sbin/dump/itime.c Wed Mar 10 20:32:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: itime.c,v 1.17 2010/02/26 02:11:40 christos Exp $ */ +/* $NetBSD: itime.c,v 1.18 2010/03/11 01:32:59 christos Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: itime.c,v 1.17 2010/02/26 02:11:40 christos Exp $"); +__RCSID("$NetBSD: itime.c,v 1.18 2010/03/11 01:32:59 christos Exp $"); #endif #endif /* not lint */ @@ -146,13 +146,18 @@ /* * Go find the entry with the same name for a lower increment * and older date. If we are doing a true incremental, then - * we can use level 9 as a ref point + * we can use any level as a ref point. */ ITITERATE(i, ddp) { if (strncmp(fname, ddp->dd_name, sizeof (ddp->dd_name)) != 0) continue; - if ((!trueinc && (ddp->dd_level >= level)) || - (trueinc && (ddp->dd_level > level))) + /* trueinc: ostensibly could omit the second clause + * since if trueinc is set, we don't care about the level + * at all. + */ + /* if ((!trueinc && (ddp->dd_level >= level)) || + (trueinc && (ddp->dd_level > level))) */ + if (!trueinc && (ddp->dd_level >= level)) continue; if (ddp->dd_ddate <= iswap32(spcl.c_ddate)) continue; Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.65 src/sbin/dump/main.c:1.66 --- src/sbin/dump/main.c:1.65 Thu Feb 25 21:11:40 2010 +++ src/sbin/dump/main.c Wed Mar 10 20:32:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.65 2010/02/26 02:11:40 christos Exp $ */ +/* $NetBSD: main.c,v 1.66 2010/03/11 01:32:59 christos Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.65 2010/02/26 02:11:40 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.66 2010/03/11 01:32:59 christos Exp $"); #endif #endif /* not lint */ @@ -181,8 +181,8 @@ honorlevel = numarg("honor level", 0L, 10L); break; - case 'i': /* "true incremental" regardless level 9 */ - level = '9'; + case 'i': /* "true incremental" regardless level */ + level = 'i'; trueinc = 1; break; @@ -470,7 +470,8 @@ needswap = fs_read_sblock(sblock_buf); - spcl.c_level = iswap32(level - '0'); + /* true incremental is always a level 10 dump */ + spcl.c_level = trueinc? iswap32(10): iswap32(level - '0'); spcl.c_type = iswap32(TS_TAPE); spcl.c_date = iswap32(spcl.c_date); spcl.c_ddate = iswap32(spcl.c_ddate);
CVS commit: src/sbin/dump
Module Name:src Committed By: christos Date: Thu Mar 11 01:32:59 UTC 2010 Modified Files: src/sbin/dump: itime.c main.c Log Message: PR/42952: The Grey Wolf: Fix for "true incremental". Don't overload level 9, use a new level "i" which is logically 10. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sbin/dump/itime.c cvs rdiff -u -r1.65 -r1.66 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/dump
Module Name:src Committed By: wiz Date: Fri Feb 26 07:01:17 UTC 2010 Modified Files: src/sbin/dump: dump.8 Log Message: -i does not take an argument. Remove unnecessary Bk/Ek. New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sbin/dump/dump.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/dump.8 diff -u src/sbin/dump/dump.8:1.59 src/sbin/dump/dump.8:1.60 --- src/sbin/dump/dump.8:1.59 Fri Feb 26 02:11:40 2010 +++ src/sbin/dump/dump.8 Fri Feb 26 07:01:17 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: dump.8,v 1.59 2010/02/26 02:11:40 christos Exp $ +.\" $NetBSD: dump.8,v 1.60 2010/02/26 07:01:17 wiz Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" Regents of the University of California. @@ -40,42 +40,18 @@ .Sh SYNOPSIS .Nm .Op Fl 0123456789aceFinStuX -.Bk -words .Op Fl B Ar records -.Ek -.Bk -words .Op Fl b Ar blocksize -.Ek -.Bk -words .Op Fl d Ar density -.Ek -.Bk -words .Op Fl f Ar file -.Ek -.Bk -words .Op Fl h Ar level -.Ek -.Bk -words .Op Fl k Ar read-blocksize -.Ek -.Bk -words .Op Fl L Ar label -.Ek -.Bk -words .Op Fl l Ar timeout -.Ek -.Bk -words .Op Fl r Ar cachesize -.Ek -.Bk -words .Op Fl s Ar feet -.Ek -.Bk -words .Op Fl T Ar date -.Ek -.Bk -words .Op Fl x Ar snap-backup -.Ek .Ar files-to-dump .Nm .Op Fl W Li \&| Fl w @@ -223,10 +199,12 @@ The default honor level is 1, so that incremental backups omit such files but full backups retain them. -.It Fl i Ar incremental +.It Fl i The dump is treated as level 9 but takes into account a previous -level 9, if one exists. This makes it possible to perform a "true -incremental" dump. +level 9, if one exists. +This makes it possible to perform a +.Dq true incremental +dump. .It Fl k Ar read-blocksize The size in kilobyte of the read buffers, rounded up to a multiple of the file system block size.
CVS commit: src/sbin/dump
Module Name:src Committed By: wiz Date: Fri Feb 26 07:01:17 UTC 2010 Modified Files: src/sbin/dump: dump.8 Log Message: -i does not take an argument. Remove unnecessary Bk/Ek. New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sbin/dump/dump.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/dump
Module Name:src Committed By: christos Date: Fri Feb 26 02:11:40 UTC 2010 Modified Files: src/sbin/dump: dump.8 dump.h itime.c main.c Log Message: PR/42883: Greywolf: Add -i flag which brings "true incremental" capability. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sbin/dump/dump.8 cvs rdiff -u -r1.45 -r1.46 src/sbin/dump/dump.h cvs rdiff -u -r1.16 -r1.17 src/sbin/dump/itime.c cvs rdiff -u -r1.64 -r1.65 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/dump
Module Name:src Committed By: christos Date: Fri Feb 26 02:11:40 UTC 2010 Modified Files: src/sbin/dump: dump.8 dump.h itime.c main.c Log Message: PR/42883: Greywolf: Add -i flag which brings "true incremental" capability. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sbin/dump/dump.8 cvs rdiff -u -r1.45 -r1.46 src/sbin/dump/dump.h cvs rdiff -u -r1.16 -r1.17 src/sbin/dump/itime.c cvs rdiff -u -r1.64 -r1.65 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/dump.8 diff -u src/sbin/dump/dump.8:1.58 src/sbin/dump/dump.8:1.59 --- src/sbin/dump/dump.8:1.58 Fri Jan 30 06:55:04 2009 +++ src/sbin/dump/dump.8 Thu Feb 25 21:11:40 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: dump.8,v 1.58 2009/01/30 11:55:04 enami Exp $ +.\" $NetBSD: dump.8,v 1.59 2010/02/26 02:11:40 christos Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" Regents of the University of California. @@ -30,7 +30,7 @@ .\" .\" @(#)dump.8 8.3 (Berkeley) 5/1/95 .\" -.Dd August 12, 2008 +.Dd February 25, 2010 .Dt DUMP 8 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd file system backup .Sh SYNOPSIS .Nm -.Op Fl 0123456789aceFnStuX +.Op Fl 0123456789aceFinStuX .Bk -words .Op Fl B Ar records .Ek @@ -147,7 +147,9 @@ option below). A level number above 0, incremental backup, tells dump to copy all files new or modified since the -last dump of a lower level. +last dump of a lower level (but see also the +.Fl i +option below). The default level is 9. .It Fl a .Dq auto-size . @@ -221,6 +223,10 @@ The default honor level is 1, so that incremental backups omit such files but full backups retain them. +.It Fl i Ar incremental +The dump is treated as level 9 but takes into account a previous +level 9, if one exists. This makes it possible to perform a "true +incremental" dump. .It Fl k Ar read-blocksize The size in kilobyte of the read buffers, rounded up to a multiple of the file system block size. @@ -551,6 +557,12 @@ .Nm command appeared in .At v6 . +.Pp +The +.Fl i +flag was inspired by the +.Fl x +flag from Sun's Solstice Backup utility. .Sh BUGS Fewer than 32 read errors on the file system are ignored. .Pp Index: src/sbin/dump/dump.h diff -u src/sbin/dump/dump.h:1.45 src/sbin/dump/dump.h:1.46 --- src/sbin/dump/dump.h:1.45 Sat Feb 16 12:58:01 2008 +++ src/sbin/dump/dump.h Thu Feb 25 21:11:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dump.h,v 1.45 2008/02/16 17:58:01 matt Exp $ */ +/* $NetBSD: dump.h,v 1.46 2010/02/26 02:11:40 christos Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -110,6 +110,7 @@ int diskfd; /* disk file descriptor */ int tapefd; /* tape file descriptor */ int pipeout; /* true => output to standard output */ +int trueinc; /* true => "true incremental", i.e use last 9 as ref */ ino_t curino; /* current inumber; used globally */ int newtape; /* new tape flag */ u_int64_t tapesize; /* estimated tape size, blocks */ Index: src/sbin/dump/itime.c diff -u src/sbin/dump/itime.c:1.16 src/sbin/dump/itime.c:1.17 --- src/sbin/dump/itime.c:1.16 Fri May 19 10:52:39 2006 +++ src/sbin/dump/itime.c Thu Feb 25 21:11:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: itime.c,v 1.16 2006/05/19 14:52:39 christos Exp $ */ +/* $NetBSD: itime.c,v 1.17 2010/02/26 02:11:40 christos Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: itime.c,v 1.16 2006/05/19 14:52:39 christos Exp $"); +__RCSID("$NetBSD: itime.c,v 1.17 2010/02/26 02:11:40 christos Exp $"); #endif #endif /* not lint */ @@ -145,12 +145,14 @@ initdumptimes(); /* * Go find the entry with the same name for a lower increment - * and older date + * and older date. If we are doing a true incremental, then + * we can use level 9 as a ref point */ ITITERATE(i, ddp) { if (strncmp(fname, ddp->dd_name, sizeof (ddp->dd_name)) != 0) continue; - if (ddp->dd_level >= level) + if ((!trueinc && (ddp->dd_level >= level)) || + (trueinc && (ddp->dd_level > level))) continue; if (ddp->dd_ddate <= iswap32(spcl.c_ddate)) continue; Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.64 src/sbin/dump/main.c:1.65 --- src/sbin/dump/main.c:1.64 Sat Jul 19 21:20:22 2008 +++ src/sbin/dump/main.c Thu Feb 25 21:11:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.64 2008/07/20 01:20:22 lukem Exp $ */ +/* $NetBSD: main.c,v 1.65 2010/02/26 02:11:40 christos Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.64 2008/07/20 01:20:22 lukem Exp $"); +__RCSID("$NetBSD: main.c,v 1.65 2010/02/26 02:11:40 christos Exp $"); #endif #endif /* not lint */ @@ -134,7 +134,7 @@ obsolete(&argc, &argv); while ((ch = getopt(argc, argv, - "0123456789aB:b:cd:eFf:h:k:l:L:nr:s:StT:uWwx:X")) != -1) +
CVS commit: src/sbin/dump
Module Name:src Committed By: spz Date: Wed Jan 27 12:20:25 UTC 2010 Modified Files: src/sbin/dump: rcache.c Log Message: range-check what we assign to int cachebufs from calculations with uint64_t usermem. This only becomes relevant if you have several TB of RAM. Promoting cachebufs to uint64_t is not necessary as it gets limited to (currently) 512 anyway. fixes the last issue of PR: 19852 To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sbin/dump/rcache.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.