NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/42952: Fix to dump(8)'s "true incremental"



>Number:         42952
>Category:       bin
>Synopsis:       Fix to dump(8)'s "true incremental"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 10 23:35:00 +0000 2010
>Originator:     The Grey Wolf
>Release:        NetBSD 5.0_RC1 [sources -current]
>Organization:

                                --*greywolf;
--
>Environment:
System: NetBSD lothlorien.starwolf.com 5.0_RC1 NetBSD 5.0_RC1 (GENERIC) #0: Wed 
Jan 28 10:59:04 PST 2009 
builds@wb25:/home/builds/ab/netbsd-5/i386/200901280002Z-obj/home/builds/ab/netbsd-5/src/sys/arch/i386/compile/GENERIC
 i386
Architecture: i386
Machine: i386
>Description:
        Dave Holland brought to my attention that a "true incremental dump"
        is not a level 9 in any sense of the word.  I have modified the code
        such that levels 0 thru 9 are preserved in their sanctity, and an
        incremental dump is registered as an 'i'.  This complicated things
        because the restore showed the dump as a "level 57".  I added a
        conditional that set spcl.c_level to 10 if (level > '9').

        Further, I discovered that the code that tests for "true incremental"
        had a second conditional test that turns out to be superfluous,
        so I simplified by removing this.
>How-To-Repeat:
>Fix:
--- main.c.orig 2010-03-10 14:19:06.000000000 -0800
+++ main.c      2010-03-10 14:37:44.000000000 -0800
@@ -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);

--- itime.c.orig        2010-03-10 14:19:12.000000000 -0800
+++ itime.c     2010-03-10 14:30:39.000000000 -0800
@@ -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;

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index