[PATCH v16 10/11] nvme: register fdp parameters with the block layer

Keith Busch kbusch at kernel.org
Tue May 6 09:26:34 PDT 2025


On Tue, May 06, 2025 at 09:13:33AM -0700, Caleb Sander Mateos wrote:
> On Tue, May 6, 2025 at 5:31 AM Kanchan Joshi <joshi.k at samsung.com> wrote:
> > @@ -2225,6 +2361,12 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns,
> >         if (!nvme_init_integrity(ns->head, &lim, info))
> >                 capacity = 0;
> >
> > +       lim.max_write_streams = ns->head->nr_plids;
> > +       if (lim.max_write_streams)
> > +               lim.write_stream_granularity = max(info->runs, U32_MAX);
> 
> What is the purpose of this max(..., U32_MAX)? Should it be min() instead?

You're right, should have been min. Because "runs" is a u64 and the
queue_limit is a u32, so U32_MAX is the upper limit, but it's not
supposed to exceed "runs". 



More information about the Linux-nvme mailing list