aboutsummaryrefslogtreecommitdiff
path: root/lib/fstree/mknode.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-07-08 17:08:34 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-08-19 18:47:52 +0200
commitce3a783daaa9b8f50d71cb3ac108e39002358a1e (patch)
tree64ba6be9882250421f2aec5a6bbae56f043157c2 /lib/fstree/mknode.c
parent7667b84cc34707c28ca0db8d24f046ec34e8c25d (diff)
Fix: libfstree: actually use a full 32 bit hard link counter
The squashfs on-disk format uses 32 bit link counters, but the fstree used 16 bit ones. Because the link count also includes child nodes, this artificially limited the number of entries in a directory to ~64k files. This patch removes the limit by switching libfstree to 32 bit counters. Reported-by: Marvin Renich <mrvn@renich.org> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/mknode.c')
-rw-r--r--lib/fstree/mknode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fstree/mknode.c b/lib/fstree/mknode.c
index f836c67..e0ab5b8 100644
--- a/lib/fstree/mknode.c
+++ b/lib/fstree/mknode.c
@@ -75,7 +75,7 @@ tree_node_t *fstree_mknode(tree_node_t *parent, const char *name,
}
if (parent != NULL) {
- if (parent->link_count == 0x0FFFF) {
+ if (parent->link_count == 0xFFFFFFFF) {
free(n);
errno = EMLINK;
return NULL;