Re: [PATCH] isofs: Fix handling of directories with small logical blocks

From: Thomas Schmitt

Date: Sun Oct 11 2026 - 16:29:21 EST


Hi,

Hengyu Liang wrote:
> mount -t iso9660 -o loop,ro lbs1024.iso /mnt

Do i get it right that lbs1024.iso contains in the Primary Volume
Descriptor at BP 129 to 132 "Logical Block Size" the value 1024
instead of 2048 ?
(Where could i get such an ISO image ? And how was it created ?)

If so:
I agree with Hengyu Liang's assessment of ECMA-119 in regard to
Logical Sector (device-related unit inspired by CD sectors) and
Logical Block (filesystem addressing unit).
Assuming that my understanding of the isofs code is correct, i am
astonished and impressed to see in isofs support for
Logical Block < Logical Sector.


But i see a possible exotic consistency problem:

The mount option block={512|1024|2048} may set the address unit for
reading the volume descriptors in isofs_fill_super():
opt->blocksize = sb_min_blocksize(s, opt->blocksize);
This means that if it gets through, it is the assumed Logical Sector
size.
Later the block size unit gets overridden by the logical block size
which was read from the chosen volume descriptor:
if (!sb_set_blocksize(s, orig_zonesize))

The problem would be that during the check for allowed crossing of
logical blocks the Logical Sector size is hardcoded as ISOFS_BLOCK_SIZE
i.e. 2048.
So if the user is allowed to set an initial Sector size, shouldn't this
be used for the check in this patch, too ?

On the other hand, the default of opt->blocksize is 1024, which
obviously does not get into effect, even with 512-byte-per-block
USB sticks.
So can mount option block={512|1024|2048} still have an effect at all ?


Have a nice day :)

Thomas