[PATCH v16 10/11] nvme: register fdp parameters with the block layer
Kanchan Joshi
joshiiitr at gmail.com
Tue May 6 11:14:27 PDT 2025
On Tue, May 6, 2025 at 9:56 PM Keith Busch <kbusch at kernel.org> wrote:
>
> 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".
Would it be better to change write_stream_granularity to "long
unsigned int" so that it matches with what is possible in nvme?
More information about the Linux-nvme
mailing list