Re: [PATCH v2] scsi: scsi_debug: fix one-partition tape setup bounds
From: "Kai Mäkisara (Kolumbus)"
Date: Thu Jun 04 2026 - 11:03:57 EST
> On 4. Jun 2026, at 16.38, James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, 2026-06-03 at 23:55 +0000, Samuel Moelius wrote:
>> The tape setup path writes partition metadata one element past the
>> allocated tape_blocks array when a one-partition configuration is
>> selected.
>>
>> That corrupts adjacent state during device initialization before any
>> command is issued.
>
> I still don't get what the actual problem is. For a single partition
> tape I can't see where scsi_debug would actually do anything with
> tape_blocks[1]. What is it that you're seeing when using scsi_debug
> that motivates this?
>
The code marks partition 1 as EOD and does not corrupt anything. The tape has partitions
until either EOD partition is encountered or TAPE_MAX_PARTITIONS is reached. I would
be very hesitant to remove this initialization.
Thanks,
Kai