summaryrefslogtreecommitdiffstats
path: root/sbin/dump
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-11-30 23:28:22 +0000
committermckusick <mckusick@FreeBSD.org>2002-11-30 23:28:22 +0000
commit1a2fd04c363ba7ab5f15238d1385d76aaee4a1d1 (patch)
tree4b0746221f2c925a0aca6c639d6343e89e3de7c0 /sbin/dump
parenteb450c7edfd8c3ccf9c14f92da9e35cb2b09300d (diff)
downloadFreeBSD-src-1a2fd04c363ba7ab5f15238d1385d76aaee4a1d1.zip
FreeBSD-src-1a2fd04c363ba7ab5f15238d1385d76aaee4a1d1.tar.gz
Mark snapshots so that dump will dump them as zero length
regular files rather than trying to interpret the snapshot. Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/traverse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 612f970..b618cdf 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -401,6 +401,14 @@ dumpino(union dinode *dp, ino_t ino)
dumpmap(dumpinomap, TS_BITS, ino);
}
CLRINO(ino, dumpinomap);
+ /*
+ * Zero out the size of a snapshot so that it will be dumped
+ * as a zero length file.
+ */
+ if ((DIP(dp, di_flags) & SF_SNAPSHOT) != 0) {
+ DIP(dp, di_size) = 0;
+ DIP(dp, di_flags) &= ~SF_SNAPSHOT;
+ }
if (sblock->fs_magic == FS_UFS1_MAGIC) {
spcl.c_mode = dp->dp1.di_mode;
spcl.c_size = dp->dp1.di_size;
@@ -442,7 +450,6 @@ dumpino(union dinode *dp, ino_t ino)
/*
* Check for short symbolic link.
*/
-#ifdef FS_44INODEFMT
if (DIP(dp, di_size) > 0 &&
DIP(dp, di_size) < sblock->fs_maxsymlinklen) {
spcl.c_addr[0] = 1;
@@ -458,7 +465,6 @@ dumpino(union dinode *dp, ino_t ino)
writerec(buf, 0);
return;
}
-#endif
/* FALLTHROUGH */
case S_IFDIR:
OpenPOWER on IntegriCloud