Re: [PATCH v3] scsi: scsi_debug: fix one-partition tape setup bounds

From: "Kai Mäkisara (Kolumbus)"

Date: Fri Jun 05 2026 - 02:03:48 EST




> On 5. Jun 2026, at 2.43, Samuel Moelius <sam.moelius@xxxxxxxxxxxxxxx> wrote:
>
> The tape setup path uses one tape_block entry as the end-of-data marker
> after the usable tape blocks. For the one-partition layout, partition 0
> uses all TAPE_UNITS data slots and partition 1's marker is written at
> tape_blocks[0] + TAPE_UNITS.
>
> Only TAPE_UNITS entries are allocated, so that marker write is one
> element past the allocation during device initialization before any
> command is issued.
>
> Allocate one extra tape_block entry for the marker. This keeps the
> existing partitioning paths unchanged while providing backing storage for
> the sentinel.
>
> Assisted-by: Codex:gpt-5.5-cyber-preview
> Signed-off-by: Samuel Moelius <sam.moelius@xxxxxxxxxxxxxxx>
> ---
> Changes in v3
> - Use TAPE_UNITS + 1 approach

Reviewed-by: Kai Mäkisara <Kai.Makisara@xxxxxxxxxxx <mailto:Kai.Makisara@xxxxxxxxxxx>>

Thanks, Kai