summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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