Rebase to upstream v82

Resolves: RHEL-99217

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
This commit is contained in:
Jeff Moyer 2025-08-26 13:58:33 -04:00
parent 0c40b4e27a
commit ee2ebd2379
4 changed files with 8 additions and 98 deletions

1
.gitignore vendored
View File

@ -43,3 +43,4 @@
/ndctl-77.tar.gz
/ndctl-78.tar.gz
/ndctl-80.tar.gz
/ndctl-82.tar.gz

View File

@ -1,94 +0,0 @@
ndctl/list: display region caps for any of BTT, PFN, DAX
JIRA: https://issues.redhat.com/browse/RHEL-80436
commit def79df43e763dd89973e0732dd49ee5f38416ac
Author: Donet Tom <donettom@linux.vnet.ibm.com>
Date: Thu Feb 20 00:20:29 2025 -0600
ndctl/list: display region caps for any of BTT, PFN, DAX
If any one of BTT, PFN, or DAX is not present, but the other two
are, then the region capabilities are not displayed in the
ndctl list -R -C command.
This is because util_region_capabilities_to_json() returns NULL
if any one of BTT, PFN, or DAX is not present.
In this patch, we have changed the logic to display all the region
capabilities that are present.
Test Results with CONFIG_BTT disabled
=====================================
Without this patch
------------------
# ./ndctl list -R -C
[
{
"dev":"region1",
"size":12884901888,
"align":16777216,
"available_size":11257511936,
"max_available_extent":9630121984,
"type":"pmem",
"iset_id":14748366918514061582,
"persistence_domain":"unknown"
},
With this patch
---------------
# ./ndctl list -R -C
[
{
"dev":"region1",
"size":12884901888,
"align":16777216,
"available_size":11257511936,
"max_available_extent":9630121984,
"type":"pmem",
"iset_id":14748366918514061582,
"capabilities":[
{
"mode":"fsdax",
"alignments":[
65536,
2097152,
1073741824
]
},
{
"mode":"devdax",
"alignments":[
65536,
2097152,
1073741824
]
}
],
"persistence_domain":"unknown"
},
Fixes: 965fa02e372f ("util: Distribute 'filter' and 'json' helpers to per-tool objects")
Signed-off-by: Donet Tom <donettom@linux.vnet.ibm.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Tested-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://lore.kernel.org/r/20250220062029.9789-1-donettom@linux.vnet.ibm.com
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
diff --git a/ndctl/json.c b/ndctl/json.c
index 23bad7f..7646882 100644
--- a/ndctl/json.c
+++ b/ndctl/json.c
@@ -381,7 +381,7 @@ struct json_object *util_region_capabilities_to_json(struct ndctl_region *region
struct ndctl_pfn *pfn = ndctl_region_get_pfn_seed(region);
struct ndctl_dax *dax = ndctl_region_get_dax_seed(region);
- if (!btt || !pfn || !dax)
+ if (!btt && !pfn && !dax)
return NULL;
jcaps = json_object_new_array();

View File

@ -1,11 +1,10 @@
Name: ndctl
Version: 80
Release: 4%{?dist}
Version: 82
Release: 1%{?dist}
Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory)
License: GPL-2.0-only and LGPL-2.1-only and CC0-1.0 and MIT
Url: https://github.com/pmem/ndctl
Source0: https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: def79df-ndctl-list-display-region-caps-for-any-of-BTT-PFN-DAX.patch
Requires: ndctl-libs%{?_isa} = %{version}-%{release}
Requires: daxctl-libs%{?_isa} = %{version}-%{release}
@ -244,6 +243,10 @@ fi
%changelog
* Tue Aug 26 2025 Jeff Moyer <jmoyer@redhat.com> - 82-1
- Rebase to upstream v82
- Resolves: RHEL-99217
* Tue Jul 22 2025 Jeff Moyer <jmoyer@redhat.com> - 80-4
- Fix listing of region capabilities (Jeff Moyer)
- Remove orphaned patch file (Jeff Moyer)

View File

@ -1 +1 @@
SHA512 (ndctl-80.tar.gz) = f8302c0c64c0b30524cc62d5af35a81bca9ed9afb94e3a9a1848e976aabb0af0824f9a12080a522ab935665ccdbf2a18ed3ac6347343446385830dae9f5736a4
SHA512 (ndctl-82.tar.gz) = 15b3533862adbb7261bc63fdb5e75ec0da5f7c4ce4d306ec8587c83eeb92abe2c2f03640aad157da0791492d4f3688d8203f965443662dff5da78b0940cdc6d7