<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/nvdimm/namespace_devs.c, branch v6.6.141</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.141</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.141'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-10-04T14:29:30+00:00</updated>
<entry>
<title>nvdimm: Fix devs leaks in scan_labels()</title>
<updated>2024-10-04T14:29:30+00:00</updated>
<author>
<name>Li Zhijian</name>
<email>lizhijian@fujitsu.com</email>
</author>
<published>2024-08-19T06:20:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18a672c62d735744c6340eb3f5e58934a5d34cf2'/>
<id>urn:sha1:18a672c62d735744c6340eb3f5e58934a5d34cf2</id>
<content type='text'>
[ Upstream commit 62c2aa6b1f565d2fc1ec11a6e9e8336ce37a6426 ]

scan_labels() leaks memory when label scanning fails and it falls back
to just creating a default "seed" namespace for userspace to configure.
Root can force the kernel to leak memory.

Allocate the minimum resources unconditionally and release them when
unneeded to avoid the memory leak.

A kmemleak reports:
unreferenced object 0xffff88800dda1980 (size 16):
  comm "kworker/u10:5", pid 69, jiffies 4294671781
  hex dump (first 16 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace (crc 0):
    [&lt;00000000c5dea560&gt;] __kmalloc+0x32c/0x470
    [&lt;000000009ed43c83&gt;] nd_region_register_namespaces+0x6fb/0x1120 [libnvdimm]
    [&lt;000000000e07a65c&gt;] nd_region_probe+0xfe/0x210 [libnvdimm]
    [&lt;000000007b79ce5f&gt;] nvdimm_bus_probe+0x7a/0x1e0 [libnvdimm]
    [&lt;00000000a5f3da2e&gt;] really_probe+0xc6/0x390
    [&lt;00000000129e2a69&gt;] __driver_probe_device+0x78/0x150
    [&lt;000000002dfed28b&gt;] driver_probe_device+0x1e/0x90
    [&lt;00000000e7048de2&gt;] __device_attach_driver+0x85/0x110
    [&lt;0000000032dca295&gt;] bus_for_each_drv+0x85/0xe0
    [&lt;00000000391c5a7d&gt;] __device_attach+0xbe/0x1e0
    [&lt;0000000026dabec0&gt;] bus_probe_device+0x94/0xb0
    [&lt;00000000c590d936&gt;] device_add+0x656/0x870
    [&lt;000000003d69bfaa&gt;] nd_async_device_register+0xe/0x50 [libnvdimm]
    [&lt;000000003f4c52a4&gt;] async_run_entry_fn+0x2e/0x110
    [&lt;00000000e201f4b0&gt;] process_one_work+0x1ee/0x600
    [&lt;000000006d90d5a9&gt;] worker_thread+0x183/0x350

Cc: Dave Jiang &lt;dave.jiang@intel.com&gt;
Cc: Ira Weiny &lt;ira.weiny@intel.com&gt;
Fixes: 1b40e09a1232 ("libnvdimm: blk labels and namespace instantiation")
Suggested-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Li Zhijian &lt;lizhijian@fujitsu.com&gt;
Reviewed-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Link: https://patch.msgid.link/20240819062045.1481298-1-lizhijian@fujitsu.com
Signed-off-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvdimm: Use kstrtobool() instead of strtobool()</title>
<updated>2023-07-19T15:42:50+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-07-13T04:50:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44f23dabdc08698b7a066300eb55db23895f5459'/>
<id>urn:sha1:44f23dabdc08698b7a066300eb55db23895f5459</id>
<content type='text'>
strtobool() is the same as kstrtobool().
However, the latter is more used within the kernel.

In order to remove strtobool() and slightly simplify kstrtox.h, switch to
the other function name.

While at it, include the corresponding header file (&lt;linux/kstrtox.h&gt;)

Reviewed-by: Vishal Verma &lt;vishal.l.verma@intel.com&gt;
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'libnvdimm-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm</title>
<updated>2022-10-15T01:41:41+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-10-15T01:41:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=19d17ab7c68b62180e0537f92400a6f798019775'/>
<id>urn:sha1:19d17ab7c68b62180e0537f92400a6f798019775</id>
<content type='text'>
Pull nvdimm updates from Dan Williams:
 "Some small cleanups and fixes in and around the nvdimm subsystem. The
  most significant change is a regression fix for nvdimm namespace
  (volume) creation when the namespace size is smaller than 2MB/

  Summary:

   - Fix nvdimm namespace creation on platforms that do not publish
     associated 'DIMM' metadata for a persistent memory region.

   - Miscellaneous fixes and cleanups"

* tag 'libnvdimm-for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  ACPI: HMAT: Release platform device in case of platform_device_add_data() fails
  dax: Remove usage of the deprecated ida_simple_xxx API
  libnvdimm/region: Allow setting align attribute on regions without mappings
  nvdimm/namespace: Fix comment typo
  nvdimm: make __nvdimm_security_overwrite_query static
  nvdimm/region: Fix kernel-doc
  nvdimm/namespace: drop unneeded temporary variable in size_store()
  nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid()
</content>
</entry>
<entry>
<title>Merge branch 'for-6.1/nvdimm' into libnvdimm-for-next</title>
<updated>2022-10-02T02:16:16+00:00</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2022-10-02T02:16:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=305a72efa791c826fe84768ca55e31adc4113ea8'/>
<id>urn:sha1:305a72efa791c826fe84768ca55e31adc4113ea8</id>
<content type='text'>
Add v6.1 content on top of some straggling updates that missed v6.0.
</content>
</entry>
<entry>
<title>nvdimm/namespace: Fix comment typo</title>
<updated>2022-09-20T17:47:18+00:00</updated>
<author>
<name>Jason Wang</name>
<email>wangborong@cdjrlc.com</email>
</author>
<published>2022-08-02T20:19:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=23a2d0c5944896ce9123f36ab62d7ca64c8b25ff'/>
<id>urn:sha1:23a2d0c5944896ce9123f36ab62d7ca64c8b25ff</id>
<content type='text'>
The double `existing' is duplicated in the comment, remove one.

Signed-off-by: Jason Wang &lt;wangborong@cdjrlc.com&gt;
Link: https://lore.kernel.org/r/20220802201918.8408-1-wangborong@cdjrlc.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>nvdimm/namespace: drop nested variable in create_namespace_pmem()</title>
<updated>2022-07-14T20:48:49+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2022-06-07T16:49:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d34213ebfea31229411583716a9ebe3610bf2d29'/>
<id>urn:sha1:d34213ebfea31229411583716a9ebe3610bf2d29</id>
<content type='text'>
Kernel build bot reported:

  namespace_devs.c:1991:10: warning: Local variable 'uuid' shadows outer variable [shadowVariable]

Refactor create_namespace_pmem() by dropping a nested version of
the same variable.

Fixes: d1c6e08e7503 ("libnvdimm/labels: Add uuid helpers")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220607164937.33967-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>nvdimm/namespace: drop unneeded temporary variable in size_store()</title>
<updated>2022-07-14T18:28:26+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2022-06-07T15:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=53fc59511fc4c567342b2ef3f7b99a086430e0b4'/>
<id>urn:sha1:53fc59511fc4c567342b2ef3f7b99a086430e0b4</id>
<content type='text'>
Refactor size_store() in order to remove temporary variable on stack
by joining conditionals.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220607153750.33639-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid()</title>
<updated>2022-07-14T18:23:36+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2022-06-07T15:25:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=36a40c37389c7a1bef3f1024c55c056304acf439'/>
<id>urn:sha1:36a40c37389c7a1bef3f1024c55c056304acf439</id>
<content type='text'>
Refactor nd_dev_to_uuid() in order to make code shorter and cleaner
by joining conditions and hence returning uuid_null only once.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220607152525.33468-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>nvdimm: Drop nd_device_lock()</title>
<updated>2022-04-28T21:01:55+00:00</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2022-04-21T15:33:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=81beea55cb7407a52bac16f7d01a415e008c910f'/>
<id>urn:sha1:81beea55cb7407a52bac16f7d01a415e008c910f</id>
<content type='text'>
Now that all NVDIMM subsystem locking is validated with custom lock
classes, there is no need for the custom usage of the lockdep_mutex.

Cc: Vishal Verma &lt;vishal.l.verma@intel.com&gt;
Cc: Dave Jiang &lt;dave.jiang@intel.com&gt;
Cc: Ira Weiny &lt;ira.weiny@intel.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Link: https://lore.kernel.org/r/165055521979.3745911.10751769706032029999.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>nvdimm: Replace lockdep_mutex with local lock classes</title>
<updated>2022-04-28T21:01:55+00:00</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2022-04-21T15:33:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a0079bc7aae5a003ecc548090b75c96d3abf490'/>
<id>urn:sha1:4a0079bc7aae5a003ecc548090b75c96d3abf490</id>
<content type='text'>
In response to an attempt to expand dev-&gt;lockdep_mutex for device_lock()
validation [1], Peter points out [2] that the lockdep API already has
the ability to assign a dedicated lock class per subsystem device-type.

Use lockdep_set_class() to override the default device_lock()
'__lockdep_no_validate__' class for each NVDIMM subsystem device-type. This
enables lockdep to detect deadlocks and recursive locking within the
device-driver core and the subsystem.

Link: https://lore.kernel.org/r/164982968798.684294.15817853329823976469.stgit@dwillia2-desk3.amr.corp.intel.com [1]
Link: https://lore.kernel.org/r/Ylf0dewci8myLvoW@hirez.programming.kicks-ass.net [2]
Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Vishal Verma &lt;vishal.l.verma@intel.com&gt;
Cc: Dave Jiang &lt;dave.jiang@intel.com&gt;
Cc: Ira Weiny &lt;ira.weiny@intel.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Link: https://lore.kernel.org/r/165055520896.3745911.8021255583475547548.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
</feed>
