Fix bogon with the nodump flag.
Submitted by: Dima Dorfman <dima@unixfreak.org>
This commit is contained in:
parent
7402675de4
commit
2c8094f344
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75689
@ -155,13 +155,15 @@ mapfiles(maxino, tapesize)
|
|||||||
if ((mode = (dp->di_mode & IFMT)) == 0)
|
if ((mode = (dp->di_mode & IFMT)) == 0)
|
||||||
continue;
|
continue;
|
||||||
/*
|
/*
|
||||||
* All dirs go in dumpdirmap; only inodes that are to
|
* Everything must go in usedinomap so that a check
|
||||||
* be dumped go in usedinomap and dumpinomap, however.
|
* for "in dumpdirmap but not in usedinomap" to detect
|
||||||
|
* dirs with nodump set has a chance of succeeding
|
||||||
|
* (this is used in mapdirs()).
|
||||||
*/
|
*/
|
||||||
|
SETINO(ino, usedinomap);
|
||||||
if (mode == IFDIR)
|
if (mode == IFDIR)
|
||||||
SETINO(ino, dumpdirmap);
|
SETINO(ino, dumpdirmap);
|
||||||
if (WANTTODUMP(dp)) {
|
if (WANTTODUMP(dp)) {
|
||||||
SETINO(ino, usedinomap);
|
|
||||||
SETINO(ino, dumpinomap);
|
SETINO(ino, dumpinomap);
|
||||||
if (mode != IFREG && mode != IFDIR && mode != IFLNK)
|
if (mode != IFREG && mode != IFDIR && mode != IFLNK)
|
||||||
*tapesize += 1;
|
*tapesize += 1;
|
||||||
@ -169,8 +171,11 @@ mapfiles(maxino, tapesize)
|
|||||||
*tapesize += blockest(dp);
|
*tapesize += blockest(dp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (mode == IFDIR)
|
if (mode == IFDIR) {
|
||||||
|
if (!nonodump && (dp->di_flags & UF_NODUMP))
|
||||||
|
CLRINO(ino, usedinomap);
|
||||||
anydirskipped = 1;
|
anydirskipped = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Restore gets very upset if the root is not dumped,
|
* Restore gets very upset if the root is not dumped,
|
||||||
@ -218,7 +223,7 @@ mapdirs(maxino, tapesize)
|
|||||||
* it isn't in usedinomap, we have to go through it to
|
* it isn't in usedinomap, we have to go through it to
|
||||||
* propagate the nodump flag.
|
* propagate the nodump flag.
|
||||||
*/
|
*/
|
||||||
nodump = (TSTINO(ino, usedinomap) == 0);
|
nodump = !nonodump && (TSTINO(ino, usedinomap) == 0);
|
||||||
if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump))
|
if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump))
|
||||||
continue;
|
continue;
|
||||||
dp = getino(ino);
|
dp = getino(ino);
|
||||||
|
Loading…
Reference in New Issue
Block a user