Re: [PATCH] isofs: bound empty directory blocks in isofs_read_level3_size()

From: Jan Kara

Date: Wed Sep 30 2026 - 06:35:28 EST


On Wed 30-09-26 11:39:40, Matthias Goergens wrote:
> Hi Honza,
>
> > Any reason why don't you do just "++i > 100" here and completely
> > remove the empty_blocks variable?
>
> Yes: i has one other use. The "if (i == 1)" further down records
> where the second section starts (i_next_section_block/offset).
> Counting empty blocks in i would move i past 1 before the second
> record is read when an empty block sits between the first two
> records, so the next-section link stays 0 and isofs_get_blocks()
> reads past the first extent into whatever follows it on disk. I
> tried your variant on a two-section image with one empty block
> between the records: v1 reads the file correctly, the variant returns
> different bytes.
>
> I'm happy to send a v2 that adds a comment saying why the count stays
> out of i, if you'd like one.

Right, that needs a bit more care but still, something like the attached
patch should work?

Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR