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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 6, 2025 at 9:56 PM Keith Busch <kbusch@xxxxxxxxxx> 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@xxxxxxxxxxx> 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?





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux