Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Guixin Liu <kanie@linux.alibaba.com>
To: Kanchan Joshi <joshi.k@samsung.com>,
	Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Hannes Reinecke <hare@suse.de>,
	nilay@linux.ibm.com, Chaitanya Kulkarni <kch@nvidia.com>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH v2 5/5] nvme: raise FDP placement handle cap to U8_MAX and warn on overflow
Date: Tue, 4 Aug 2026 10:20:35 +0800	[thread overview]
Message-ID: <a2c9fc27-1cb6-4c12-b62d-724bdffc0197@linux.alibaba.com> (raw)
In-Reply-To: <fe8f6e8c-185a-4089-848b-2c965fed84a8@samsung.com>



在 2026/8/1 00:36, Kanchan Joshi 写道:
> On 7/31/2026 8:50 AM, Guixin Liu wrote:
>> @@ -2342,7 +2350,7 @@ static int nvme_query_fdp_info(struct nvme_ns *ns, struct nvme_ns_info *info)
>>    	if (!info->runs)
>>    		return ret;
>>    
>> -	size = struct_size(ruhs, ruhsd, S8_MAX - 1);
>> +	size = struct_size(ruhs, ruhsd, NVME_MAX_PLIDS);
>>    	ruhs = kzalloc(size, GFP_KERNEL);
>>    	if (!ruhs)
>>    		return -ENOMEM;
>> @@ -2357,8 +2365,13 @@ static int nvme_query_fdp_info(struct nvme_ns *ns, struct nvme_ns_info *info)
>>    		goto free;
>>    	}
>>    
>> -	head->nr_plids = le16_to_cpu(ruhs->nruhsd);
>> -	head->nr_plids = min_t(u16, head->nr_plids, S8_MAX - 1);
>> +	nr_plids = le16_to_cpu(ruhs->nruhsd);
>> +	if (nr_plids > NVME_MAX_PLIDS)
> I'd move this check down; after if (!head->nr_plids) part below.
>
>> +		dev_warn(ctrl->device,
>> +			 "FDP RUH status reports %u placement handles, capping at %u\n",
>> +			 nr_plids, NVME_MAX_PLIDS);
>> +
>> +	head->nr_plids = min_t(u16, nr_plids, NVME_MAX_PLIDS);
> And will keep this in above if block, alongside dev_warn(). And kill
> that min_t with a simple
> 	head->nr_plids = NVME_MAX_PLIDS;
>
>>    	if (!head->nr_plids)
>>    		goto free;
>>    
> Modulo these nits
> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Changed in v3, thanks.

Best Regards,
Guixin Liu



      reply	other threads:[~2026-08-04  2:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31  3:20 [PATCH v2 0/5] nvme: a few error-path and validation fixes Guixin Liu
2026-07-31  3:20 ` [PATCH v2 1/5] nvmet: fix NULL pointer dereference in nvmet_execute_identify_nslist() Guixin Liu
2026-07-31  3:20 ` [PATCH v2 2/5] nvmet: propagate percpu_ref_init() failure in nvmet_ns_enable() Guixin Liu
2026-07-31  3:20 ` [PATCH v2 3/5] nvme-pci: release descriptor pools on probe failure Guixin Liu
2026-07-31  3:20 ` [PATCH v2 4/5] nvme: clamp FDP placement handle count to the buffer size Guixin Liu
2026-07-31  3:20 ` [PATCH v2 5/5] nvme: raise FDP placement handle cap to U8_MAX and warn on overflow Guixin Liu
2026-07-31 16:36   ` Kanchan Joshi
2026-08-04  2:20     ` Guixin Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2c9fc27-1cb6-4c12-b62d-724bdffc0197@linux.alibaba.com \
    --to=kanie@linux.alibaba.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=joshi.k@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nilay@linux.ibm.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox