Page MenuHomeFreeBSD

D51593.id159280.diff
No OneTemporary

D51593.id159280.diff

diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c
--- a/usr.sbin/makefs/zfs/fs.c
+++ b/usr.sbin/makefs/zfs/fs.c
@@ -384,22 +384,34 @@
links = 1; /* .. */
objsize = 1; /* .. */
- /*
- * The size of a ZPL directory is the number of entries
- * (including "." and ".."), and the link count is the number of
- * entries which are directories (including "." and "..").
- */
- for (fsnode *c = fsnode_isroot(cur) ? cur->next : cur->child;
- c != NULL; c = c->next) {
- switch (c->type) {
- case S_IFDIR:
- links++;
- /* FALLTHROUGH */
- case S_IFREG:
- case S_IFLNK:
- objsize++;
- break;
+ if ((cur->inode->flags & FI_ROOT) == 0 ) {
+ /*
+ * The size of a ZPL directory is the number of entries
+ * (including "." and ".."), and the link count is the
+ * number of entries which are directories
+ * (including "." and "..").
+ */
+ for (fsnode *c =
+ fsnode_isroot(cur) ? cur->next : cur->child;
+ c != NULL; c = c->next) {
+ switch (c->type) {
+ case S_IFDIR:
+ links++;
+ /* FALLTHROUGH */
+ case S_IFREG:
+ case S_IFLNK:
+ objsize++;
+ break;
+ }
}
+ } else {
+ /*
+ * Root directory children do belong to
+ * different dataset and this directory is
+ * empty in the current objset.
+ */
+ links++; /* . */
+ objsize++; /* . */
}
/* The root directory is its own parent. */

File Metadata

Mime Type
text/plain
Expires
Fri, May 15, 8:38 PM (20 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33098174
Default Alt Text
D51593.id159280.diff (1 KB)

Event Timeline