Compare commits
11 Commits
dcbf882175
...
5a317bc12c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a317bc12c | ||
|
|
a7f53337ab | ||
|
|
749e46bd2e | ||
|
|
6831ab571d | ||
|
|
9cdb9d8e7f | ||
|
|
0ccd4f8695 | ||
|
|
5d6f4ea992 | ||
|
|
3122eb8379 | ||
|
|
73a38a83d8 | ||
|
|
488b181664 | ||
|
|
66c7213c19 |
@ -1,40 +0,0 @@
|
||||
From 6694afe31dd67d186199a58d2252be5ea3472692 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Williams <dan.j.williams@intel.com>
|
||||
Date: Tue, 12 Jan 2021 23:15:09 -0800
|
||||
Subject: [PATCH] ndctl/test: Fix device-dax mremap() test
|
||||
|
||||
The test_dax_remap() test is a regression check for mishandling of mremap()
|
||||
in the presence of pmd_devmap(). My understanding is that it was a fuzzing
|
||||
condition not something an application would want to do in practice.
|
||||
|
||||
On recent kernels with commit 73d5e0629919 ("mremap: check if it's possible
|
||||
to split original vma"), the test fails for device-dax. That seems an
|
||||
equally acceptable result of attempting this remap, so update the test
|
||||
rather than ask the kernel to preserve the old behaviour.
|
||||
|
||||
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
||||
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
|
||||
Link: https://lore.kernel.org/r/161052210936.1804207.17896246772670985157.stgit@dwillia2-desk3.amr.corp.intel.com
|
||||
---
|
||||
test/dax-pmd.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/test/dax-pmd.c b/test/dax-pmd.c
|
||||
index b1251db..7648e34 100644
|
||||
--- a/test/dax-pmd.c
|
||||
+++ b/test/dax-pmd.c
|
||||
@@ -69,6 +69,11 @@ int test_dax_remap(struct ndctl_test *test, int dax_fd, unsigned long align, voi
|
||||
|
||||
remap = mremap(addr, REMAP_SIZE, REMAP_SIZE, MREMAP_MAYMOVE|MREMAP_FIXED, anon);
|
||||
|
||||
+ if (remap == MAP_FAILED) {
|
||||
+ fprintf(stderr, "%s: mremap failed, that's ok too\n", __func__);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (remap != anon) {
|
||||
rc = -ENXIO;
|
||||
perror("mremap");
|
||||
--
|
||||
2.33.0
|
||||
|
||||
49
0001-zero_info_block-skip-seed-devices.patch
Normal file
49
0001-zero_info_block-skip-seed-devices.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From fb13dfb8d84c4f0a749665c8f07179450b199f3e Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Moyer <jmoyer@redhat.com>
|
||||
Date: Tue, 9 Feb 2021 16:51:53 -0500
|
||||
Subject: [PATCH] zero_info_block: skip seed devices
|
||||
|
||||
Currently, ndctl destroy-namespace -f all will output errors of the
|
||||
form:
|
||||
|
||||
Error: destroy namespace: namespace0.0 failed to enable for zeroing, continuing
|
||||
|
||||
for any zero-sized namespace. That particular namespace looks like this:
|
||||
|
||||
{
|
||||
"dev":"namespace0.0",
|
||||
"mode":"raw",
|
||||
"size":0,
|
||||
"uuid":"00000000-0000-0000-0000-000000000000",
|
||||
"sector_size":512,
|
||||
"state":"disabled"
|
||||
}
|
||||
|
||||
This patch skips over namespaces with size=0 when zeroing out info
|
||||
blocks.
|
||||
|
||||
Fixes: 46654c2d60b70 ("ndctl/namespace: Always zero info-blocks")
|
||||
Reported-by: Zhang Yi <yizhan@redhat.com>
|
||||
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
|
||||
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
|
||||
Link: https://lore.kernel.org/r/x49r1lohpty.fsf@segfault.boston.devel.redhat.com
|
||||
---
|
||||
ndctl/namespace.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/ndctl/namespace.c b/ndctl/namespace.c
|
||||
index 1feb74d..1e8a2cd 100644
|
||||
--- a/ndctl/namespace.c
|
||||
+++ b/ndctl/namespace.c
|
||||
@@ -1052,6 +1052,9 @@ static int zero_info_block(struct ndctl_namespace *ndns)
|
||||
void *buf = NULL, *read_buf = NULL;
|
||||
char path[50];
|
||||
|
||||
+ if (ndctl_namespace_get_size(ndns) == 0)
|
||||
+ return 1;
|
||||
+
|
||||
ndctl_namespace_set_raw_mode(ndns, 1);
|
||||
rc = ndctl_namespace_enable(ndns);
|
||||
if (rc < 0) {
|
||||
--
|
||||
2.37.0.windows.1
|
||||
15
0002-exclude-cxl_monitor_service.patch
Normal file
15
0002-exclude-cxl_monitor_service.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/cxl/meson.build b/cxl/meson.build
|
||||
index 61b4d87..9792158 100644
|
||||
--- a/cxl/meson.build
|
||||
+++ b/cxl/meson.build
|
||||
@@ -12,8 +12,10 @@ cxl_src = [
|
||||
]
|
||||
|
||||
if get_option('systemd').enabled()
|
||||
+if get_option('libtracefs').enabled()
|
||||
install_data('cxl-monitor.service', install_dir : systemdunitdir)
|
||||
endif
|
||||
+endif
|
||||
|
||||
deps = [
|
||||
cxl_dep,
|
||||
Binary file not shown.
BIN
ndctl-78.tar.gz
Normal file
BIN
ndctl-78.tar.gz
Normal file
Binary file not shown.
136
ndctl.spec
136
ndctl.spec
@ -1,18 +1,23 @@
|
||||
Name: ndctl
|
||||
Version: 71.1
|
||||
Release: 4
|
||||
Version: 78
|
||||
Release: 2
|
||||
Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory)
|
||||
License: GPL-2, LGPL-2.1, MIT, CC0-1.0
|
||||
License: GPL-2 AND LGPL-2.1 AND MIT AND CC0-1.0
|
||||
Group: System Environment/Base
|
||||
Url: https://github.com/pmem/ndctl
|
||||
Source0: https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch1: 0001-ndctl-test-Fix-device-dax-mremap-test.patch
|
||||
Patch1: 0001-zero_info_block-skip-seed-devices.patch
|
||||
Patch2: 0002-exclude-cxl_monitor_service.patch
|
||||
|
||||
Requires: ndctl-libs%{?_isa} = %{version}-%{release}
|
||||
Requires: daxctl-libs%{?_isa} = %{version}-%{release}
|
||||
Requires: cxl-libs%{?_isa} = %{version}-%{release}
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: rubygem-asciidoctor
|
||||
BuildRequires: libtraceevent-devel
|
||||
%define asciidoctor -Dasciidoctor=enabled
|
||||
%define libtracefs -Dlibtracefs=disabled
|
||||
BuildRequires: xmlto
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
@ -23,7 +28,9 @@ BuildRequires: pkgconfig(uuid)
|
||||
BuildRequires: pkgconfig(json-c)
|
||||
BuildRequires: pkgconfig(bash-completion)
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
BuildRequires: keyutils-libs-devel
|
||||
BuildRequires: keyutils-libs-devel
|
||||
BuildRequires: iniparser
|
||||
BuildRequires: meson
|
||||
|
||||
%description
|
||||
Utility library for managing the "libnvdimm" subsystem. The "libnvdimm"
|
||||
@ -31,6 +38,9 @@ subsystem defines a kernel device model and control message interface for
|
||||
platform NVDIMM resources like those defined by the ACPI 6+ NFIT (NVDIMM
|
||||
Firmware Interface Table).
|
||||
|
||||
%if 0%{?flatpak}
|
||||
%global _udevrulesdir %{_prefix}/lib/udev/rules.d
|
||||
%endif
|
||||
|
||||
%package -n ndctl-devel
|
||||
Summary: Development files for libndctl
|
||||
@ -54,6 +64,26 @@ the Linux kernel Device-DAX facility. This facility enables DAX mappings
|
||||
of performance / feature differentiated memory without need of a
|
||||
filesystem.
|
||||
|
||||
%package -n cxl-cli
|
||||
Summary: Manage CXL devices
|
||||
License: GPLv2
|
||||
Group: System Environment/Base
|
||||
Requires: cxl-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description -n cxl-cli
|
||||
The cxl utility provides enumeration and provisioning commands for
|
||||
the Linux kernel CXL devices.
|
||||
|
||||
%package -n cxl-devel
|
||||
Summary: Development files for libcxl
|
||||
License: LGPLv2
|
||||
Group: Development/Libraries
|
||||
Requires: cxl-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description -n cxl-devel
|
||||
This package contains libraries and header files for developing applications
|
||||
that use libcxl, a library for enumerating and communicating with CXL devices.
|
||||
|
||||
%package -n daxctl-devel
|
||||
Summary: Development files for libdaxctl
|
||||
License: LGPLv2
|
||||
@ -87,22 +117,27 @@ Device DAX is a facility for establishing DAX mappings of performance /
|
||||
feature-differentiated memory. daxctl-libs provides an enumeration /
|
||||
control API for these devices.
|
||||
|
||||
%package -n cxl-libs
|
||||
Summary: Management library for CXL devices
|
||||
License: LGPLv2
|
||||
Group: System Environment/Libraries
|
||||
|
||||
%description -n cxl-libs
|
||||
libcxl is a library for enumerating and communicating with CXL devices.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n ndctl-%{version} -p1
|
||||
|
||||
%build
|
||||
echo %{version} > version
|
||||
./autogen.sh
|
||||
%configure --disable-static --disable-silent-rules
|
||||
make %{?_smp_mflags}
|
||||
%meson %{?asciidoctor} %{?libtracefs} -Dversion-tag=%{version}
|
||||
%meson_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
||||
%meson_install
|
||||
|
||||
%check
|
||||
make check
|
||||
%meson_test
|
||||
|
||||
%post -n ndctl-libs -p /sbin/ldconfig
|
||||
|
||||
@ -112,23 +147,66 @@ make check
|
||||
|
||||
%postun -n daxctl-libs -p /sbin/ldconfig
|
||||
|
||||
%post -n cxl-libs -p /sbin/ldconfig
|
||||
|
||||
%postun -n cxl-libs -p /sbin/ldconfig
|
||||
|
||||
%define bashcompdir %(pkg-config --variable=completionsdir bash-completion)
|
||||
|
||||
%pre
|
||||
if [ -f %{_sysconfdir}/ndctl/monitor.conf ] ; then
|
||||
if ! [ -f %{_sysconfdir}/ndctl.conf.d/monitor.conf ] ; then
|
||||
cp -a %{_sysconfdir}/ndctl/monitor.conf /var/run/ndctl-monitor.conf-migration
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
if [ -f /var/run/ndctl-monitor.conf-migration ] ; then
|
||||
config_found=false
|
||||
while read line ; do
|
||||
[ -n "$line" ] || continue
|
||||
case "$line" in
|
||||
\#*) continue ;;
|
||||
esac
|
||||
config_found=true
|
||||
break
|
||||
done < /var/run/ndctl-monitor.conf-migration
|
||||
if $config_found ; then
|
||||
echo "[monitor]" > %{_sysconfdir}/ndctl.conf.d/monitor.conf
|
||||
cat /var/run/ndctl-monitor.conf-migration >> %{_sysconfdir}/ndctl.conf.d/monitor.conf
|
||||
fi
|
||||
rm /var/run/ndctl-monitor.conf-migration
|
||||
fi
|
||||
|
||||
%files
|
||||
%license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0
|
||||
%{_bindir}/ndctl
|
||||
%{_mandir}/man1/ndctl*
|
||||
%{bashcompdir}/
|
||||
%config(noreplace) %{_sysconfdir}/ndctl/monitor.conf
|
||||
%{bashcompdir}/ndctl
|
||||
%{_unitdir}/ndctl-monitor.service
|
||||
%{_sysconfdir}/ndctl/keys/keys.readme
|
||||
%{_sysconfdir}/modprobe.d/nvdimm-security.conf
|
||||
%dir %{_sysconfdir}/ndctl.conf.d
|
||||
%config(noreplace) %{_sysconfdir}/ndctl.conf.d/monitor.conf
|
||||
%config(noreplace) %{_sysconfdir}/ndctl.conf.d/ndctl.conf
|
||||
|
||||
%files -n daxctl
|
||||
%license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0
|
||||
%{_bindir}/daxctl
|
||||
%{_mandir}/man1/daxctl*
|
||||
%{_datadir}/daxctl/daxctl.conf
|
||||
%{bashcompdir}/daxctl
|
||||
%{_unitdir}/daxdev-reconfigure@.service
|
||||
%config %{_udevrulesdir}/90-daxctl-device.rules
|
||||
%dir %{_sysconfdir}/daxctl.conf.d/
|
||||
%config(noreplace) %{_sysconfdir}/daxctl.conf.d/daxctl.example.conf
|
||||
|
||||
%files -n cxl-cli
|
||||
%license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0
|
||||
%{_bindir}/cxl
|
||||
%{_mandir}/man1/cxl*
|
||||
%{bashcompdir}/cxl
|
||||
%exclude %{_unitdir}/cxl-monitor.service
|
||||
|
||||
%files -n ndctl-libs
|
||||
%doc README.md
|
||||
@ -140,6 +218,11 @@ make check
|
||||
%license LICENSES/preferred/LGPL-2.1 LICENSES/other/MIT LICENSES/other/CC0-1.0
|
||||
%{_libdir}/libdaxctl.so.*
|
||||
|
||||
%files -n cxl-libs
|
||||
%doc README.md
|
||||
%license LICENSES/preferred/LGPL-2.1 LICENSES/other/MIT LICENSES/other/CC0-1.0
|
||||
%{_libdir}/libcxl.so.*
|
||||
|
||||
%files -n ndctl-devel
|
||||
%license LICENSES/preferred/LGPL-2.1
|
||||
%{_includedir}/ndctl/
|
||||
@ -152,8 +235,33 @@ make check
|
||||
%{_libdir}/libdaxctl.so
|
||||
%{_libdir}/pkgconfig/libdaxctl.pc
|
||||
|
||||
%files -n cxl-devel
|
||||
%license LICENSES/preferred/LGPL-2.1
|
||||
%{_includedir}/cxl/
|
||||
%{_libdir}/libcxl.so
|
||||
%{_libdir}/pkgconfig/libcxl.pc
|
||||
%{_mandir}/man3/cxl*
|
||||
%{_mandir}/man3/libcxl.3*
|
||||
|
||||
%changelog
|
||||
* Mon Apr 8 2024 wuyifeng <wuyifeng10@huawei.com> - 78-2
|
||||
- fix ndctl delete monitor.service
|
||||
|
||||
* Wed Jan 17 2024 wuyifeng <wuyifeng10@huawei.com> - 78-1
|
||||
- upgrade to version 78:
|
||||
-incorporate up to 6.5 kernel
|
||||
-add new cxl commands
|
||||
-fix some bugs detail see:github.com/pmem/ndctl
|
||||
|
||||
* Fri Feb 10 2023 suweifeng <suweifeng1@huawei.com> - 75-1
|
||||
- upgrade to version 75
|
||||
|
||||
* Fri Jan 6 2023 lihaoxiang <lihaoxiang9@huawei.com> - 74-2
|
||||
- fix ndctl delete namespace exception
|
||||
|
||||
* Mon Oct 31 2022 liusirui <liusirui@huawei.com> - 74-1
|
||||
- update version 74
|
||||
|
||||
* Thu Oct 20 2022 liusirui <liusirui@huawei.com> - 71.1-4
|
||||
- backport patch to fix test case
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user