All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Schmitt" <scdbackup@gmx.net>
To: grub-devel@gnu.org
Subject: grub-mkrescue fails with HFS+ error possibly due to directory size
Date: Thu, 11 Jun 2020 14:17:02 +0200	[thread overview]
Message-ID: <40657092990747773@scdbackup.webframe.org> (raw)

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



             reply	other threads:[~2020-06-11 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 12:17 Thomas Schmitt [this message]
2020-06-12  9:30 ` grub-mkrescue fails with HFS+ error possibly due to directory size Thomas Schmitt
2020-07-25  8:38   ` Thomas Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40657092990747773@scdbackup.webframe.org \
    --to=scdbackup@gmx.net \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.