lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1690859824.141757055784098.JavaMail.epsvc@epcpadp2new>
Date: Thu, 4 Sep 2025 19:58:29 +0530
From: Neeraj Kumar <s.neeraj@...sung.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: linux-cxl@...r.kernel.org, nvdimm@...ts.linux.dev,
	linux-kernel@...r.kernel.org, gost.dev@...sung.com,
	a.manzanares@...sung.com, vishak.g@...sung.com, neeraj.kernel@...il.com,
	cpgs@...sung.com
Subject: Re: [PATCH V2 07/20] nvdimm/namespace_label: Update namespace
 init_labels and its region_uuid

On 19/08/25 01:56PM, Ira Weiny wrote:
>Neeraj Kumar wrote:
>> nd_mapping->labels maintains the list of labels present into LSA.
>> init_labels() prepares this list while adding new label into LSA
>> and updates nd_mapping->labels accordingly. During cxl region
>> creation nd_mapping->labels list and LSA was updated with one
>> region label. Therefore during new namespace label creation
>> pre-include the previously created region label, so increase
>> num_labels count by 1.
>
>Why does the count of the labels in the list not work?
>
>static int init_labels(struct nd_mapping *nd_mapping, int num_labels)
>{
>        int i, old_num_labels = 0;
>...
>        mutex_lock(&nd_mapping->lock);
>        list_for_each_entry(label_ent, &nd_mapping->labels, list)
>                old_num_labels++;
>        mutex_unlock(&nd_mapping->lock);
>...
>

Hi Ira,

init_labels() allocates new label based on comparison with existing
count of the labels in the list and passed num_labels. If num_labels
is greater than count of the labels in the list then new label is
allocated and stored in list for later usage

...
         mutex_lock(&nd_mapping->lock);
	list_for_each_entry(label_ent, &nd_mapping->labels, list)
		old_num_labels++;
	mutex_unlock(&nd_mapping->lock);

	for (i = old_num_labels; i < num_labels; i++) {
		label_ent = kzalloc(sizeof(*label_ent), GFP_KERNEL);
		if (!label_ent)
			return -ENOMEM;

		mutex_lock(&nd_mapping->lock);
		list_add_tail(&label_ent->list, nd_mapping->labels);
		mutex_unlock(&nd_mapping->lock);
	}
...


>>
>> Also updated nsl_set_region_uuid with region uuid with which
>> namespace is associated with.
>
>Whenever using a word like 'Also' in the commit message ask if this should be a
>separate patch.  I'm thinking this hunk should be somewhere else in the series.
>
>Ira

Sure Ira, Yes both hunks are not associated, I just added both to avoid
extra commit. I will create separate commit to update region_uuid and
will remove 'Also' part from commit message.


Regards,
Neeraj


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ