All of lore.kernel.org
 help / color / mirror / Atom feed
* grub-mkrescue fails with HFS+ error possibly due to directory size
@ 2020-06-11 12:17 Thomas Schmitt
  2020-06-12  9:30 ` Thomas Schmitt
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Schmitt @ 2020-06-11 12:17 UTC (permalink / raw)
  To: grub-devel

Hi,

i just got a bug report about Guix ISO image production failing with

  libisofs: FAILURE : HFS+ map nodes aren't implemented

The message stems from the HFS+ contribution to libisofs by Vladimir
Serbinenko in 2012. About the only program which asks libisofs to
produce HFS+ is grub-mkrescue, which to my knowledge is indeed used
by Guix.

I need a confirmation of my preliminary diagnosis and, if true, a decision
how important HFS+ is nowadays for grub-mkrescue.

I believe to see a limitation to 30720 files per directory, which would
become an official limitation of grub-mkrescue if HFS+ production shall
be continued for I386, X86_64, and POWERPC_IEEE1275.

------------------------------------------------------------------------

The code which issues the error is in
  https://dev.lovelyhq.com/libburnia/libisofs/raw/master/libisofs/hfsplus.c
line 1791:

    if (target->hfsp_nnodes > (cat_node_size - 0x100) * 8)
      {
        iso_msg_submit(target->image->id, ISO_MANGLE_TOO_MUCH_FILES, 0,
                        "HFS+ map nodes aren't implemented");
        ret = ISO_MANGLE_TOO_MUCH_FILES;
        goto ex;
      }

This looks not like a mangling problem but more like a plain overflow.

target->hfsp_nnodes is a counter which i have difficulties to understand:

      target->hfsp_levels[level].level_size++;
      target->hfsp_nnodes += target->hfsp_levels[level].level_size;

cat_node_size is set by

    target->hfsp_cat_node_size = 2 * target->opts->hfsp_block_size;
    ...
    cat_node_size = target->hfsp_cat_node_size;

target->opts->hfsp_block_size is most probably HFSPLUS_DEFAULT_BLOCK_SIZE
= 2048.

My rough theory is that a HFS+ directory cannot have more than
   (4096 - 256) * 8 = 30720
file names. There seems to be a workaround "HFS+ map nodes". But the HFS+
code in libisofs reports not to have it implemented.


Have a nice day :)

Thomas



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-25  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-11 12:17 grub-mkrescue fails with HFS+ error possibly due to directory size Thomas Schmitt
2020-06-12  9:30 ` Thomas Schmitt
2020-07-25  8:38   ` Thomas Schmitt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.