From aed35c78c6a51a4b4c37ebda5643d2246842fb74 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 8 Jul 2022 17:08:34 +0200 Subject: 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 Signed-off-by: David Oberhollenzer --- lib/fstree/hardlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/fstree/hardlink.c') diff --git a/lib/fstree/hardlink.c b/lib/fstree/hardlink.c index 11ab566..f45acf7 100644 --- a/lib/fstree/hardlink.c +++ b/lib/fstree/hardlink.c @@ -62,7 +62,7 @@ int fstree_resolve_hard_link(fstree_t *fs, tree_node_t *node) return -1; } - if (node->link_count == 0x0FFFF) { + if (node->link_count == 0xFFFFFFFF) { errno = EMLINK; return -1; } -- cgit v1.2.3