From 183882f0c4fe8a368b882caace621edc685685c4 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 04:57:01 +0000 Subject: import ndctl-62-1.el7 --- diff --git a/.gitignore b/.gitignore index 5c65791..9b63ddb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ndctl-58.2.tar.gz +SOURCES/ndctl-62.tar.gz diff --git a/.ndctl.metadata b/.ndctl.metadata index eac222b..b4b822d 100644 --- a/.ndctl.metadata +++ b/.ndctl.metadata @@ -1 +1 @@ -012c3667301923cceb326b7b7cda5a612bfa0c96 SOURCES/ndctl-58.2.tar.gz +0f906e39f1af10fe60748b8862e761fe36abd985 SOURCES/ndctl-62.tar.gz 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 deleted file mode 100644 index 931f154..0000000 --- a/SOURCES/4a934b7-ndctl-list-fix-crash-when-listing-idle-device-dax-instances.patch +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100644 index 854e99e..0000000 --- a/SOURCES/5443d71-dax_io-fix-unknown-parameter-handling.patch +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index feaeadf..0000000 --- a/SOURCES/9dc0d66-ndctl-fix-static-analysis-report-unchecked-sscanf.patch +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index 47931ef..0000000 --- a/SOURCES/btt_check_arenas-fix-use-of-uninitialized-variable.patch +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index 408e86b..0000000 --- a/SOURCES/e8700eb-btt_check_bitmap-initialize-rc.patch +++ /dev/null @@ -1,37 +0,0 @@ -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 index 6e43507..8cd10ba 100644 --- a/SPECS/ndctl.spec +++ b/SPECS/ndctl.spec @@ -1,16 +1,11 @@ Name: ndctl -Version: 58.2 -Release: 3%{?dist} +Version: 62 +Release: 1%{?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} @@ -25,9 +20,7 @@ BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(uuid) BuildRequires: pkgconfig(json-c) BuildRequires: pkgconfig(bash-completion) -%ifarch x86_64 -BuildRequires: pkgconfig(libpmem) -%endif +BuildRequires: systemd %description Utility library for managing the "libnvdimm" subsystem. The "libnvdimm" @@ -94,20 +87,12 @@ control API for these devices. %prep %setup -q ndctl-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 +chmod +x test/monitor.sh %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 +%configure --disable-static --disable-silent-rules make %{?_smp_mflags} %install @@ -115,7 +100,11 @@ make %{?_smp_mflags} find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %check +# There are x86-isms in the unit tests + +%ifarch x86_64 make check +%endif %post -n ndctl-libs -p /sbin/ldconfig @@ -126,12 +115,17 @@ make check %postun -n daxctl-libs -p /sbin/ldconfig %define bashcompdir %(pkg-config --variable=completionsdir bash-completion) +%define udevdir %(pkg-config --variable=udevdir udev) %files %license util/COPYING licenses/BSD-MIT licenses/CC0 %{_bindir}/ndctl %{_mandir}/man1/ndctl* %{bashcompdir}/ +%{_sysconfdir}/ndctl/monitor.conf +%{_unitdir}/ndctl-monitor.service +%{_udevrulesdir}/80-ndctl.rules +%{udevdir}/ndctl-udev %files -n daxctl %license util/COPYING licenses/BSD-MIT licenses/CC0 @@ -162,6 +156,34 @@ make check %changelog +* Thu Aug 23 2018 Jeff Moyer - 62-1 +- Rebase to v62 (Jeff Moyer) + - a new monitor command / daemon + - an ndctl udev rule for recording the unsafe shutdown count + - smart error injection + - create-namespace fix for fragmented namespaces +- Resolves: bz#1610649 bz#1611833 bz#1456320 + +* Mon Jul 30 2018 Jeff Moyer - 60.3-4 +- Apply all patches (Jeff Moyer) +- Related: bz#1456320 + +* Mon Jul 30 2018 Jeff Moyer - 60.3-3 +- Add monitor daemon (Jeff Moyer) +- Resolves: bz#1456320 + +* Mon Jul 30 2018 Jeff Moyer - 60.3-2.1 +- Remove the btt.rules udev rule file. This was fixed in-kernel. (Jeff Moyer) +- Related: bz#1585122 + +* Thu Jun 14 2018 Jeff Moyer - 60.3-2 +- Fix an issue where btt partitions were not showing up (Jeff Moyer) +- Resolves: bz#1585122 + +* Fri Jun 8 2018 Jeff Moyer - 60.3-1 +- Rebase to v60.3 +- Resolves: bz#1517753 + * Fri Oct 20 2017 Jeff Moyer - 58.2-3 - fix more static checker issues - Related: bz#1457566 bz#1471807 bz#1456954