[hfs-user] Map node linkage

Patrick Dirks pwd@apple.com
Fri, 11 Jun 2004 09:44:42 -0700


On Jun 11, 2004, at 8:33 AM, Pierre Duhem wrote:

> Hello,
>
> I'm still working on my HFS/HFS+ image formatter and I get a problem.
>
> I build a HFS image with about 41000 little files.
>
> The catalog mapping bitmap in the B-tree header overflows at about 
> 6,500
> files. The first independent node overflows at about 18,300 and the 
> second at
> about 30,400 files.
>
> Therefore, I have following linkage:
> 0 (header) points to 0x0800
> 0x0800 points to 0x1770
> 0x1770 points to 0x26E0

Is node 0x26E0 an actual header node?  The chain of forward links in 
the header node list should end with a forward pointer of zero in the 
last node.
>
> However, when I run fsck_hfs on the CD-ROM I burned from this image, I
> get an error message:
>
> Invalid map node linkage
> 4, 9952
>
> Btw, 9952 is 0x26E0 in decimal, which means that the program is not
> happy with my solution, in particular with the last node in the linked
> list.
>
> When looking at several volumes formatted and filled on a Macintosh
> (Mac OS X 1O.2, if it matters), I see that there is always a totally
> empty node (with nothing in it, even in the node header) pointed to by
> the last node where the bitmap was used.
>
> Should I also implement this?

No - that sounds like a bug.  No node in the tree should ever be 
without a node header.  Just link the valid nodes together with a zero 
link in the last node.

If you can reproduce the generation of a volume with an empty node 
linked in, please let us know.  That sounds like a bug.

Thanks,
-Patrick.
>
> Thanks in advance for any clue.
>
>
> -- 
> Best Regards
> Pierre Duhem
> Logiciels & Services Duhem, Paris (France)
> duhem@macdisk.com
>