From bcf6bc997e5b18cf357d0d61c741df1ee22af1b5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:39:30 +0000 Subject: import ndctl-58.2-3.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c65791 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ndctl-58.2.tar.gz diff --git a/.ndctl.metadata b/.ndctl.metadata new file mode 100644 index 0000000..eac222b --- /dev/null +++ b/.ndctl.metadata @@ -0,0 +1 @@ +012c3667301923cceb326b7b7cda5a612bfa0c96 SOURCES/ndctl-58.2.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/4a934b7-ndctl-list-fix-crash-when-listing-idle-device-dax-instances.patch b/SOURCES/4a934b7-ndctl-list-fix-crash-when-listing-idle-device-dax-instances.patch new file mode 100644 index 0000000..931f154 --- /dev/null +++ b/SOURCES/4a934b7-ndctl-list-fix-crash-when-listing-idle-device-dax-instances.patch @@ -0,0 +1,55 @@ +ndctl, list: fix crash when listing idle device-dax instances + +BZ: + +commit 4a934b716888d116895e96b0a48a6f5a562cedd0 +Author: Dan Williams +Date: Thu Sep 28 15:40:54 2017 -0700 + + ndctl, list: fix crash when listing idle device-dax instances + + The following crash results from running 'ndctl list -i' on an inactive + namespace that is claimed for device-dax operation. + + Program received signal SIGSEGV, Segmentation fault. + daxctl_dev_get_devname (dev=0x0) at libdaxctl.c:566 + 566 return devpath_to_devname(dev->dev_path); + (gdb) bt + #0 daxctl_dev_get_devname (dev=0x0) at libdaxctl.c:566 + #1 0x0000555555563b39 in util_namespace_to_json + at ../util/json.c:751 + + By definition the 'chardev' attribute for a device-dax instance can not + be found if the device-dax instance is disabled, because enabling the + namespace creates the child character device(s). + + Signed-off-by: Dan Williams + +diff --git a/util/json.c b/util/json.c +index dac8692..d1ee351 100644 +--- a/util/json.c ++++ b/util/json.c +@@ -747,12 +747,18 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns, + } else if (dax_region) { + struct daxctl_dev *dev; + ++ /* ++ * We can only find/list these device-dax ++ * details when the instance is enabled. ++ */ + dev = daxctl_dev_get_first(dax_region); +- name = daxctl_dev_get_devname(dev); +- jobj = json_object_new_string(name); +- if (!jobj) +- goto err; +- json_object_object_add(jndns, "chardev", jobj); ++ if (dev) { ++ name = daxctl_dev_get_devname(dev); ++ jobj = json_object_new_string(name); ++ if (!jobj) ++ goto err; ++ json_object_object_add(jndns, "chardev", jobj); ++ } + } + } else if (ndctl_namespace_get_type(ndns) != ND_DEVICE_NAMESPACE_IO) { + ndctl_namespace_get_uuid(ndns, uuid); diff --git a/SOURCES/5443d71-dax_io-fix-unknown-parameter-handling.patch b/SOURCES/5443d71-dax_io-fix-unknown-parameter-handling.patch new file mode 100644 index 0000000..854e99e --- /dev/null +++ b/SOURCES/5443d71-dax_io-fix-unknown-parameter-handling.patch @@ -0,0 +1,41 @@ +dax_io: fix unknown parameter handling + +BZ: + +commit 5443d71625ea1082fb987fbce5eddb66c0a1e613 +Author: Jeff Moyer +Date: Fri Oct 20 11:41:41 2017 -0400 + + dax_io: fix unknown parameter handling + + The loop will never run more than once, since there's a + return. What's more, the following code, which prints out + the usage statement, also won't run. Let's change this to + look more like other commands. Print out invalid options + and then print out the usage. usage_with_options will exit, + so no need for a return there. + + Signed-off-by: Jeff Moyer + +diff --git a/daxctl/io.c b/daxctl/io.c +index 27e7463..2f8cb4a 100644 +--- a/daxctl/io.c ++++ b/daxctl/io.c +@@ -526,15 +526,11 @@ int cmd_io(int argc, const char **argv, void *daxctl_ctx) + struct ndctl_ctx *ndctl_ctx; + + argc = parse_options(argc, argv, options, u, 0); +- for (i = 0; i < argc; i++) { ++ for (i = 0; i < argc; i++) + fail("Unknown parameter \"%s\"\n", argv[i]); +- return -EINVAL; +- } + +- if (argc) { ++ if (argc) + usage_with_options(u, options); +- return 0; +- } + + if (!io.dev[0].parm_path && !io.dev[1].parm_path) { + usage_with_options(u, options); diff --git a/SOURCES/9dc0d66-ndctl-fix-static-analysis-report-unchecked-sscanf.patch b/SOURCES/9dc0d66-ndctl-fix-static-analysis-report-unchecked-sscanf.patch new file mode 100644 index 0000000..feaeadf --- /dev/null +++ b/SOURCES/9dc0d66-ndctl-fix-static-analysis-report-unchecked-sscanf.patch @@ -0,0 +1,35 @@ +ndctl: fix static analysis report, unchecked sscanf + +BZ: + +commit 9dc0d660414d6da0f1cd89c80c94128b90603aa7 +Author: Dan Williams +Date: Mon Oct 2 08:59:56 2017 -0700 + + ndctl: fix static analysis report, unchecked sscanf + + Static analysis flags some occasions of unchecked sscanf return value. + + Cc: Yasunori Goto + Signed-off-by: Dan Williams + +diff --git a/util/json.c b/util/json.c +index d1ee351..0c92c3b 100644 +--- a/util/json.c ++++ b/util/json.c +@@ -374,11 +374,12 @@ static int compare_dimm_number(const void *p1, const void *p2) + const char *dimm2_name = ndctl_dimm_get_devname(dimm2); + int num1, num2; + +- sscanf(dimm1_name, "nmem%d", &num1); +- sscanf(dimm2_name, "nmem%d", &num2); ++ if (sscanf(dimm1_name, "nmem%d", &num1) != 1) ++ num1 = 0; ++ if (sscanf(dimm2_name, "nmem%d", &num2) != 1) ++ num2 = 0; + + return num1 - num2; +- + } + + static struct json_object *badblocks_to_jdimms(struct ndctl_region *region, diff --git a/SOURCES/btt_check_arenas-fix-use-of-uninitialized-variable.patch b/SOURCES/btt_check_arenas-fix-use-of-uninitialized-variable.patch new file mode 100644 index 0000000..47931ef --- /dev/null +++ b/SOURCES/btt_check_arenas-fix-use-of-uninitialized-variable.patch @@ -0,0 +1,29 @@ +commit 775293e93fbc9efafa4672ba8698e427613927f6 +Author: Jeff Moyer +Date: Mon Oct 16 15:07:38 2017 -0400 + + btt_check_arenas: fix use of uninitialized variable + + Coverity complains that rc, passed to btt_xlat_status, may be + used uninitialized. Further, we could then dereference a NULL + pointer. Fix this. + + Signed-off-by: Jeff Moyer + +diff --git a/ndctl/check.c b/ndctl/check.c +index 915bb9d..93f95c6 100644 +--- a/ndctl/check.c ++++ b/ndctl/check.c +@@ -582,9 +582,10 @@ static int btt_check_arenas(struct btt_chk *bttc) + break; + } + +- btt_xlat_status(a, rc); +- if (rc) ++ if (a && rc != BTT_OK) { ++ btt_xlat_status(a, rc); + return -ENXIO; ++ } + return 0; + } + diff --git a/SOURCES/e8700eb-btt_check_bitmap-initialize-rc.patch b/SOURCES/e8700eb-btt_check_bitmap-initialize-rc.patch new file mode 100644 index 0000000..408e86b --- /dev/null +++ b/SOURCES/e8700eb-btt_check_bitmap-initialize-rc.patch @@ -0,0 +1,37 @@ +btt_check_bitmap: initialize rc + +BZ: + +commit e8700eb1656c84fa29ab0dbfb63db9b0aa0a17a5 +Author: Jeff Moyer +Date: Fri Oct 20 11:52:21 2017 -0400 + + btt_check_bitmap: initialize rc + + It may be possible that rc is never set before returning from + the function. nfree would have to be zero, and the bitmap + would have to be full. Fix it. + + Signed-off-by: Jeff Moyer + +diff --git a/ndctl/check.c b/ndctl/check.c +index 915bb9d..dafd6a8 100644 +--- a/ndctl/check.c ++++ b/ndctl/check.c +@@ -508,7 +508,7 @@ static int btt_check_bitmap(struct arena_info *a) + { + unsigned long *bm; + u32 i, btt_mapping; +- int rc; ++ int rc = BTT_BITMAP_ERROR; + + bm = bitmap_alloc(a->internal_nlba); + if (bm == NULL) +@@ -521,7 +521,6 @@ static int btt_check_bitmap(struct arena_info *a) + info(a->bttc, + "arena %d: internal block %#x is referenced by two map entries\n", + a->num, btt_mapping); +- rc = BTT_BITMAP_ERROR; + goto out; + } + bitmap_set(bm, btt_mapping, 1); diff --git a/SPECS/ndctl.spec b/SPECS/ndctl.spec new file mode 100644 index 0000000..6e43507 --- /dev/null +++ b/SPECS/ndctl.spec @@ -0,0 +1,218 @@ +Name: ndctl +Version: 58.2 +Release: 3%{?dist} +Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory) +License: GPLv2 +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 +Patch0: 9dc0d66-ndctl-fix-static-analysis-report-unchecked-sscanf.patch +Patch1: btt_check_arenas-fix-use-of-uninitialized-variable.patch +Patch2: 4a934b7-ndctl-list-fix-crash-when-listing-idle-device-dax-instances.patch +Patch3: e8700eb-btt_check_bitmap-initialize-rc.patch +Patch4: 5443d71-dax_io-fix-unknown-parameter-handling.patch + +Requires: ndctl-libs%{?_isa} = %{version}-%{release} +Requires: daxctl-libs%{?_isa} = %{version}-%{release} +BuildRequires: autoconf +BuildRequires: asciidoc +BuildRequires: xmlto +BuildRequires: automake +BuildRequires: libtool +BuildRequires: pkgconfig +BuildRequires: pkgconfig(libkmod) +BuildRequires: pkgconfig(libudev) +BuildRequires: pkgconfig(uuid) +BuildRequires: pkgconfig(json-c) +BuildRequires: pkgconfig(bash-completion) +%ifarch x86_64 +BuildRequires: pkgconfig(libpmem) +%endif + +%description +Utility library for managing the "libnvdimm" subsystem. The "libnvdimm" +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). + + +%package -n ndctl-devel +Summary: Development files for libndctl +License: LGPLv2 +Group: Development/Libraries +Requires: ndctl-libs%{?_isa} = %{version}-%{release} + +%description -n ndctl-devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package -n daxctl +Summary: Manage Device-DAX instances +License: GPLv2 +Group: System Environment/Base +Requires: daxctl-libs%{?_isa} = %{version}-%{release} + +%description -n daxctl +The daxctl utility provides enumeration and provisioning commands for +the Linux kernel Device-DAX facility. This facility enables DAX mappings +of performance / feature differentiated memory without need of a +filesystem. + +%package -n daxctl-devel +Summary: Development files for libdaxctl +License: LGPLv2 +Group: Development/Libraries +Requires: daxctl-libs%{?_isa} = %{version}-%{release} + +%description -n daxctl-devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}, a library for enumerating +"Device DAX" devices. Device DAX is a facility for establishing DAX +mappings of performance / feature-differentiated memory. + + +%package -n ndctl-libs +Summary: Management library for "libnvdimm" subsystem devices (Non-volatile Memory) +License: LGPLv2 +Group: System Environment/Libraries +Requires: daxctl-libs%{?_isa} = %{version}-%{release} + + +%description -n ndctl-libs +Libraries for %{name}. + +%package -n daxctl-libs +Summary: Management library for "Device DAX" devices +License: LGPLv2 +Group: System Environment/Libraries + +%description -n daxctl-libs +Device DAX is a facility for establishing DAX mappings of performance / +feature-differentiated memory. daxctl-libs provides an enumeration / +control API for these devices. + + +%prep +%setup -q ndctl-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +%build +echo %{version} > version +./autogen.sh +%ifarch x86_64 +%configure --disable-static --enable-local --disable-silent-rules --with-libpmem +%else +%configure --disable-static --enable-local --disable-silent-rules +%endif +make %{?_smp_mflags} + +%install +%make_install +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' + +%check +make check + +%post -n ndctl-libs -p /sbin/ldconfig + +%postun -n ndctl-libs -p /sbin/ldconfig + +%post -n daxctl-libs -p /sbin/ldconfig + +%postun -n daxctl-libs -p /sbin/ldconfig + +%define bashcompdir %(pkg-config --variable=completionsdir bash-completion) + +%files +%license util/COPYING licenses/BSD-MIT licenses/CC0 +%{_bindir}/ndctl +%{_mandir}/man1/ndctl* +%{bashcompdir}/ + +%files -n daxctl +%license util/COPYING licenses/BSD-MIT licenses/CC0 +%{_bindir}/daxctl +%{_mandir}/man1/daxctl* + +%files -n ndctl-libs +%doc README.md +%license util/COPYING licenses/BSD-MIT licenses/CC0 +%{_libdir}/libndctl.so.* + +%files -n daxctl-libs +%doc README.md +%license util/COPYING licenses/BSD-MIT licenses/CC0 +%{_libdir}/libdaxctl.so.* + +%files -n ndctl-devel +%license util/COPYING +%{_includedir}/ndctl/ +%{_libdir}/libndctl.so +%{_libdir}/pkgconfig/libndctl.pc + +%files -n daxctl-devel +%license util/COPYING +%{_includedir}/daxctl/ +%{_libdir}/libdaxctl.so +%{_libdir}/pkgconfig/libdaxctl.pc + + +%changelog +* Fri Oct 20 2017 Jeff Moyer - 58.2-3 +- fix more static checker issues +- Related: bz#1457566 bz#1471807 bz#1456954 + +* Fri Oct 20 2017 Jeff Moyer - 58.2-2 +- add in missing patch files +- Related: bz#1457566 bz#1471807 bz#1456954 + +* Mon Oct 16 2017 Jeff Moyer - 58.2-1 +- rebase to v58.2 +- remove patches that were backported from later versions +- we now support >4k faults, so remove rhel-only patches +- add libpmem dependency, and gate it on x86_64 +- pull in static checker fix for uncheck sscanf result +- fix up use of uninitialized variable +- Related: bz#1457566 bz#1471807 bz#1456954 + +* Tue May 30 2017 Jeff Moyer - 56-2 +- bump release +- Related: bz#1440902 bz#1446689 + +* Wed May 24 2017 Jeff Moyer - 56-2 +- Update documentation to reflect 4k alignment +- Add support for the MSFT family of DSM functions +- Resolves: bz#1440902 bz#1446689 + +* Sun Mar 26 2017 Jeff Moyer - 56-1 +- Rebase to upstream version 56 +- Default to 4k alignment for device dax +- Resolves: bz#1384873 bz#1384642 bz#1349233 bz#1357451 + +* Mon Aug 29 2016 Dave Anderson - 54.1 +- Update to 54.1 to address ixpdimm_sw requirements +- Resolves bz#1271425 + +* Wed Jul 6 2016 Jeff Moyer - 53.1-4 +- Fix up duplicate "-v" documentation in man page +- Fix bogus test in invalidate_namespace_options +- Resolves: bz#1350404 bz#1271425 + +* Mon Jun 20 2016 Jeff Moyer - 53.1-3 +- make ndctl Require ndctl-libs-{version}-{release} +- Resolves bz#1271425 + +* Wed Jun 1 2016 Jeff Moyer - 53.1-2 +- initial import for RHEL +- Resolves bz#1271425 + +* Fri May 27 2016 Dan Williams - 53-1 +- add daxctl-libs + daxctl-devel packages +- add bash completion + +* Mon Apr 04 2016 Dan Williams - 52-1 +- Initial rpm submission to Fedora