[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-xorriso] grub-mkrescue hfsplus GPT partition is not mountable o

From: Thomas Schmitt
Subject: Re: [Bug-xorriso] grub-mkrescue hfsplus GPT partition is not mountable on Linux
Date: Sat, 26 Dec 2015 12:39:05 +0100


i hopefully identified the cause of the i/o error with kernel
    [  359.020970] hfsplus: walked past end of dir

It seems to be an original mistake by Vladimir (who normally
makes much less mistakes than i do).
Since Andrei is surely more familiar with Vladimir's coding habits
and quite surely has more clue about HFS+, i post my analysis for


In  libisofs/hfsplus.c  there is a function  create_tree() :


It converts file objects from the libisofs tree model into objects
of the HFS+ tree model. The function returns 0 without creating
a new HFS+ tree object for files which it deems to be ignorable.
In case of error the return value is < 0.
In case of successful creation of HFS+ object and sub objects
it returns ISO_SUCCESS, which is > 0.

The two callers of create_tree() return error, if they receive
a return value < 0.
But they increment the directory children counter without
regarding return value 0.

This happens in the loop for populating the root directory


and in the loop for recursively populating other directories


In my test runs, two files get ignored in the root directory:
  /boot.catalog  ... because it is not a data file in the libisofs
                     model but rather a boot catalog.
                     (For HFS+ this difference would not matter.)
  /efi.img ......... because it is explicitely hidden from HFS+.
                     (Not so clear why libisofs/eltorito.c hides
                      the first EFI boot image from HFS+. Shrug.)

So the HFS+ root directory gets a .nchildren count of 6, but only 4
HFS+ file objects get registered for populating the root directory.

The remedy is to increment .nchildren only if create_tree() returned
a value > 0.
After i changed both loops, i get from grub-mkrescue an ISO, where
i can mount and explore /dev/sdb3 (via GPT) without i/o error.



Have a nice day :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]