Re: [PATCH v3 5/5] nvme: raise FDP placement handle cap to U8_MAX and warn on overflow

Nilay Shroff <[email protected]> Wed, 5 Aug 2026 20:46:36 +0530
Newsgroups org.infradead.lists.linux-nvme
Message-ID <[email protected]>
On 8/4/26 7:49 AM, Guixin Liu wrote:
> he RUH status buffer and the placement-handle clamp used S8_MAX - 1
> (126) as the maximum descriptor count. That value was picked only so the
> io-mgmt-receive result fit in a page, not because of any protocol or
> driver restriction.
> 
> The meaningful upper bound is U8_MAX: write hints (bio->bi_write_stream)
> are u8, so placement handles beyond U8_MAX can never be selected. Size
> the buffer and clamp nr_plids to U8_MAX, and emit a dev_warn() when the
> device reports more handles than the driver tracks so the truncation is
> observable.
> 
> Suggested-by: Kanchan Joshi<[email protected]>
> Signed-off-by: Guixin Liu<[email protected]>
> Reviewed-by: Kanchan Joshi<[email protected]>

Looks good to me.

Reviewed-by: Nilay Shroff <[email protected]>