From 4e69d4743fdee3911d74f79cabc3cd9db67220f7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:40:00 +0000 Subject: import ndctl-58.2-3.el7 --- diff --git a/.gitignore b/.gitignore index c28ab3f..5c65791 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ndctl-56.tar.gz +SOURCES/ndctl-58.2.tar.gz diff --git a/.ndctl.metadata b/.ndctl.metadata index 2986c08..eac222b 100644 --- a/.ndctl.metadata +++ b/.ndctl.metadata @@ -1 +1 @@ -99dbdae3609c85270dae0530aec0206e6ad36e88 SOURCES/ndctl-56.tar.gz +012c3667301923cceb326b7b7cda5a612bfa0c96 SOURCES/ndctl-58.2.tar.gz diff --git a/SOURCES/22bffbe-daxctl-add-libuuid-to-the-build.patch b/SOURCES/22bffbe-daxctl-add-libuuid-to-the-build.patch deleted file mode 100644 index 4e6543a..0000000 --- a/SOURCES/22bffbe-daxctl-add-libuuid-to-the-build.patch +++ /dev/null @@ -1,26 +0,0 @@ -daxctl: add libuuid to the build - -BZ: - -commit 22bffbecb16d2aa7ed072fb55a18445977ee16b8 -Author: Dan Williams -Date: Mon Feb 13 21:01:25 2017 -0800 - - daxctl: add libuuid to the build - - daxctl does have dependencies on the uuid library via util/json.c, but - the build only seems to fail in a Debian build environment. Fix this up. - - Reported-by: Yilong Ren - Signed-off-by: Dan Williams - -diff --git a/daxctl/Makefile.am b/daxctl/Makefile.am -index 9153c41..fe467d0 100644 ---- a/daxctl/Makefile.am -+++ b/daxctl/Makefile.am -@@ -10,4 +10,5 @@ daxctl_SOURCES =\ - daxctl_LDADD =\ - lib/libdaxctl.la \ - ../libutil.a \ -+ $(UUID_LIBS) \ - $(JSON_LIBS) diff --git a/SOURCES/2cf2acc-libndctl-add-support-for-the-MSFT-family-of-DSM-functions.patch b/SOURCES/2cf2acc-libndctl-add-support-for-the-MSFT-family-of-DSM-functions.patch deleted file mode 100644 index 7b2c9db..0000000 --- a/SOURCES/2cf2acc-libndctl-add-support-for-the-MSFT-family-of-DSM-functions.patch +++ /dev/null @@ -1,301 +0,0 @@ -libndctl: add support for the MSFT family of DSM functions - -BZ: - -commit 2cf2acca0288389a39ac823a42a5e048575d52db -Author: Lijun Pan -Date: Thu Apr 6 12:17:38 2017 -0500 - - libndctl: add support for the MSFT family of DSM functions - - This patch retrieves the health data from NVDIMM-N via - the MSFT _DSM function[1], following JESD245A[2] standards. - Now 'ndctl list --dimms --health --idle' could work - on MSFT type NVDIMM-N, but limited to health_state, - temperature_celsius, and life_used_percentage. - - Sample output of 'ndclt list --dimms --health --idle' - { - "dev":"nmem0", - "id":"802c-0f-1711-1648dd20", - "state":"disabled", - "health":{ - "health_state":"ok", - "temperature_celsius":27.000000, - "life_used_percentage":3 - } - } - - [1]. https://msdn.microsoft.com/library/windows/hardware/mt604741 - [2]. https://www.jedec.org/sites/default/files/docs/JESD245A.pdf - - Cc: Stuart Hayes - Signed-off-by: Lijun Pan - Tested-by: Linda Knippers - Signed-off-by: Dan Williams - -diff -up ndctl-56/ndctl/lib/Makefile.am.orig ndctl-56/ndctl/lib/Makefile.am ---- ndctl-56/ndctl/lib/Makefile.am.orig 2017-02-07 16:16:07.000000000 -0500 -+++ ndctl-56/ndctl/lib/Makefile.am 2017-05-24 15:41:41.203723211 -0400 -@@ -32,6 +32,7 @@ endif - if ENABLE_SMART - libndctl_la_SOURCES += libndctl-smart.c - libndctl_la_SOURCES += libndctl-hpe1.c -+libndctl_la_SOURCES += libndctl-msft.c - endif - - EXTRA_DIST += libndctl.sym -diff -up ndctl-56/ndctl/lib/libndctl-msft.c.orig ndctl-56/ndctl/lib/libndctl-msft.c ---- ndctl-56/ndctl/lib/libndctl-msft.c.orig 2017-05-24 15:41:41.205723213 -0400 -+++ ndctl-56/ndctl/lib/libndctl-msft.c 2017-05-24 15:41:41.204723212 -0400 -@@ -0,0 +1,140 @@ -+/* -+ * Copyright (C) 2016-2017 Dell, Inc. -+ * Copyright (C) 2016 Hewlett Packard Enterprise Development LP -+ * Copyright (c) 2016, Intel Corporation. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms and conditions of the GNU Lesser General Public License, -+ * version 2.1, as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope it will be useful, but WITHOUT ANY -+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -+ * more details. -+ */ -+#include -+#include -+#include -+#include -+#include "libndctl-private.h" -+#include "ndctl-msft.h" -+ -+#define CMD_MSFT(_c) ((_c)->msft) -+#define CMD_MSFT_SMART(_c) (CMD_MSFT(_c)->u.smart.data) -+ -+static struct ndctl_cmd *msft_dimm_cmd_new_smart(struct ndctl_dimm *dimm) -+{ -+ struct ndctl_bus *bus = ndctl_dimm_get_bus(dimm); -+ struct ndctl_ctx *ctx = ndctl_bus_get_ctx(bus); -+ struct ndctl_cmd *cmd; -+ size_t size; -+ struct ndn_pkg_msft *msft; -+ -+ if (!ndctl_dimm_is_cmd_supported(dimm, ND_CMD_CALL)) { -+ dbg(ctx, "unsupported cmd\n"); -+ return NULL; -+ } -+ -+ size = sizeof(*cmd) + sizeof(struct ndn_pkg_msft); -+ cmd = calloc(1, size); -+ if (!cmd) -+ return NULL; -+ -+ cmd->dimm = dimm; -+ ndctl_cmd_ref(cmd); -+ cmd->type = ND_CMD_CALL; -+ cmd->size = size; -+ cmd->status = 1; -+ -+ msft = CMD_MSFT(cmd); -+ msft->gen.nd_family = NVDIMM_FAMILY_MSFT; -+ msft->gen.nd_command = NDN_MSFT_CMD_SMART; -+ msft->gen.nd_fw_size = 0; -+ msft->gen.nd_size_in = offsetof(struct ndn_msft_smart, status); -+ msft->gen.nd_size_out = sizeof(msft->u.smart); -+ msft->u.smart.status = 0; -+ -+ cmd->firmware_status = &msft->u.smart.status; -+ -+ return cmd; -+} -+ -+static int msft_smart_valid(struct ndctl_cmd *cmd) -+{ -+ if (cmd->type != ND_CMD_CALL || -+ cmd->size != sizeof(*cmd) + sizeof(struct ndn_pkg_msft) || -+ CMD_MSFT(cmd)->gen.nd_family != NVDIMM_FAMILY_MSFT || -+ CMD_MSFT(cmd)->gen.nd_command != NDN_MSFT_CMD_SMART || -+ cmd->status != 0) -+ return cmd->status < 0 ? cmd->status : -EINVAL; -+ return 0; -+} -+ -+static unsigned int msft_cmd_smart_get_flags(struct ndctl_cmd *cmd) -+{ -+ if (msft_smart_valid(cmd) < 0) -+ return UINT_MAX; -+ -+ /* below health data can be retrieved via MSFT _DSM function 11 */ -+ return NDN_MSFT_SMART_HEALTH_VALID | -+ NDN_MSFT_SMART_TEMP_VALID | -+ NDN_MSFT_SMART_USED_VALID; -+} -+ -+static unsigned int num_set_bit_health(__u16 num) -+{ -+ int i; -+ __u16 n = num & 0x7FFF; -+ unsigned int count = 0; -+ -+ for (i = 0; i < 15; i++) -+ if (!!(n & (1 << i))) -+ count++; -+ -+ return count; -+} -+ -+static unsigned int msft_cmd_smart_get_health(struct ndctl_cmd *cmd) -+{ -+ unsigned int health; -+ unsigned int num; -+ -+ if (msft_smart_valid(cmd) < 0) -+ return UINT_MAX; -+ -+ num = num_set_bit_health(CMD_MSFT_SMART(cmd)->health); -+ if (num == 0) -+ health = 0; -+ else if (num < 2) -+ health = ND_SMART_NON_CRITICAL_HEALTH; -+ else if (num < 3) -+ health = ND_SMART_CRITICAL_HEALTH; -+ else -+ health = ND_SMART_FATAL_HEALTH; -+ -+ return health; -+} -+ -+static unsigned int msft_cmd_smart_get_temperature(struct ndctl_cmd *cmd) -+{ -+ if (msft_smart_valid(cmd) < 0) -+ return UINT_MAX; -+ -+ return CMD_MSFT_SMART(cmd)->temp * 16; -+} -+ -+static unsigned int msft_cmd_smart_get_life_used(struct ndctl_cmd *cmd) -+{ -+ if (msft_smart_valid(cmd) < 0) -+ return UINT_MAX; -+ -+ return 100 - CMD_MSFT_SMART(cmd)->nvm_lifetime; -+} -+ -+struct ndctl_smart_ops * const msft_smart_ops = &(struct ndctl_smart_ops) { -+ .new_smart = msft_dimm_cmd_new_smart, -+ .smart_get_flags = msft_cmd_smart_get_flags, -+ .smart_get_health = msft_cmd_smart_get_health, -+ .smart_get_temperature = msft_cmd_smart_get_temperature, -+ .smart_get_life_used = msft_cmd_smart_get_life_used, -+}; -diff -up ndctl-56/ndctl/lib/libndctl-private.h.orig ndctl-56/ndctl/lib/libndctl-private.h ---- ndctl-56/ndctl/lib/libndctl-private.h.orig 2017-02-07 16:16:07.000000000 -0500 -+++ ndctl-56/ndctl/lib/libndctl-private.h 2017-05-24 15:41:41.206723214 -0400 -@@ -32,6 +32,7 @@ - #include - #include - #include "ndctl-hpe1.h" -+#include "ndctl-msft.h" - - #define SZ_16M 0x01000000 - -@@ -196,6 +197,7 @@ struct ndctl_cmd { - struct nd_cmd_clear_error clear_err[0]; - #endif - struct ndn_pkg_hpe1 hpe1[0]; -+ struct ndn_pkg_msft msft[0]; - struct nd_cmd_smart smart[0]; - struct nd_cmd_smart_threshold smart_t[0]; - struct nd_cmd_get_config_size get_size[0]; -@@ -226,9 +228,11 @@ struct ndctl_smart_ops { - #if HAS_SMART == 1 - struct ndctl_smart_ops * const intel_smart_ops; - struct ndctl_smart_ops * const hpe1_smart_ops; -+struct ndctl_smart_ops * const msft_smart_ops; - #else - static struct ndctl_smart_ops * const intel_smart_ops = NULL; - static struct ndctl_smart_ops * const hpe1_smart_ops = NULL; -+static struct ndctl_smart_ops * const msft_smart_ops = NULL; - #endif - - /* internal library helpers for conditionally defined command numbers */ -diff -up ndctl-56/ndctl/lib/libndctl.c.orig ndctl-56/ndctl/lib/libndctl.c ---- ndctl-56/ndctl/lib/libndctl.c.orig 2017-02-07 16:16:07.000000000 -0500 -+++ ndctl-56/ndctl/lib/libndctl.c 2017-05-24 15:41:41.208723216 -0400 -@@ -1254,6 +1254,8 @@ static void *add_dimm(void *parent, int - dimm->dsm_family = strtoul(buf, NULL, 0); - if (dimm->dsm_family == NVDIMM_FAMILY_HPE1) - dimm->smart_ops = hpe1_smart_ops; -+ if (dimm->dsm_family == NVDIMM_FAMILY_MSFT) -+ dimm->smart_ops = msft_smart_ops; - - dimm->formats = formats; - sprintf(path, "%s/nfit/format", dimm_base); -diff -up ndctl-56/ndctl/lib/ndctl-msft.h.orig ndctl-56/ndctl/lib/ndctl-msft.h ---- ndctl-56/ndctl/lib/ndctl-msft.h.orig 2017-05-24 15:41:41.210723218 -0400 -+++ ndctl-56/ndctl/lib/ndctl-msft.h 2017-05-24 15:41:41.209723217 -0400 -@@ -0,0 +1,63 @@ -+/* -+ * Copyright (C) 2016-2017 Dell, Inc. -+ * Copyright (C) 2016 Hewlett Packard Enterprise Development LP -+ * Copyright (c) 2014-2015, Intel Corporation. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms and conditions of the GNU Lesser General Public License, -+ * version 2.1, as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope it will be useful, but WITHOUT ANY -+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -+ * more details. -+ */ -+#ifndef __NDCTL_MSFT_H__ -+#define __NDCTL_MSFT_H__ -+ -+enum { -+ NDN_MSFT_CMD_QUERY = 0, -+ -+ /* non-root commands */ -+ NDN_MSFT_CMD_SMART = 11, -+}; -+ -+/* NDN_MSFT_CMD_SMART */ -+#define NDN_MSFT_SMART_HEALTH_VALID ND_SMART_HEALTH_VALID -+#define NDN_MSFT_SMART_TEMP_VALID ND_SMART_TEMP_VALID -+#define NDN_MSFT_SMART_USED_VALID ND_SMART_USED_VALID -+ -+/* -+ * This is actually function 11 data, -+ * This is the closest I can find to match smart -+ * Microsoft _DSM does not have smart function -+ */ -+struct ndn_msft_smart_data { -+ __u16 health; -+ __u16 temp; -+ __u8 err_thresh_stat; -+ __u8 warn_thresh_stat; -+ __u8 nvm_lifetime; -+ __u8 count_dram_uncorr_err; -+ __u8 count_dram_corr_err; -+} __attribute__((packed)); -+ -+struct ndn_msft_smart { -+ __u32 status; -+ union { -+ __u8 buf[9]; -+ struct ndn_msft_smart_data data[0]; -+ }; -+} __attribute__((packed)); -+ -+union ndn_msft_cmd { -+ __u32 query; -+ struct ndn_msft_smart smart; -+} __attribute__((packed)); -+ -+struct ndn_pkg_msft { -+ struct nd_cmd_pkg gen; -+ union ndn_msft_cmd u; -+} __attribute__((packed)); -+ -+#endif /* __NDCTL_MSFT_H__ */ 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/77d84b2-ndctl-create-namespace-include-dax-info-in-operation-result.patch b/SOURCES/77d84b2-ndctl-create-namespace-include-dax-info-in-operation-result.patch deleted file mode 100644 index 7b962e7..0000000 --- a/SOURCES/77d84b2-ndctl-create-namespace-include-dax-info-in-operation-result.patch +++ /dev/null @@ -1,59 +0,0 @@ -ndctl, create-namespace: include dax info in operation result - -BZ: - -commit 77d84b249ef51b6dbccd988e42ce2ab2962a9b36 -Author: Dan Williams -Date: Thu Mar 2 14:10:11 2017 -0800 - - ndctl, create-namespace: include dax info in operation result - - When modifying or creating a namespace in "dax" mode, include the - device-dax information so that resulting character device is included in - the output. - - Before: - # ndctl create-namespace --reconfig=namespace1.0 --mode=dax --force - { - "dev":"namespace1.0", - "mode":"dax", - "size":4225761280, - "uuid":"55082055-70f8-40eb-b131-d59f6f537df5" - } - - After: - # ndctl create-namespace --reconfig=namespace1.0 --mode=dax --force - { - "dev":"namespace1.0", - "mode":"dax", - "size":4225761280, - "uuid":"1ccc310a-04af-4a57-88a4-6011c2825b95", - "daxregion":{ - "id":1, - "size":4225761280, - "align":2097152, - "devices":[ - { - "chardev":"dax1.0", - "size":4225761280 - } - ] - } - } - - Reported-by: Dave Jiang - Signed-off-by: Dan Williams - -diff --git a/ndctl/builtin-xaction-namespace.c b/ndctl/builtin-xaction-namespace.c -index 46d651e..05575c5 100644 ---- a/ndctl/builtin-xaction-namespace.c -+++ b/ndctl/builtin-xaction-namespace.c -@@ -361,7 +361,7 @@ static int setup_namespace(struct ndctl_region *region, - error("%s: failed to enable\n", - ndctl_namespace_get_devname(ndns)); - } else { -- struct json_object *jndns = util_namespace_to_json(ndns, 0, 0); -+ struct json_object *jndns = util_namespace_to_json(ndns, 0, 1); - - if (jndns) - printf("%s\n", json_object_to_json_string_ext(jndns, 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/SOURCES/rhel-ndctl-document-4k-alignment-default.patch b/SOURCES/rhel-ndctl-document-4k-alignment-default.patch deleted file mode 100644 index a837974..0000000 --- a/SOURCES/rhel-ndctl-document-4k-alignment-default.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ndctl-56.vanilla/Documentation/ndctl-create-namespace.txt 2017-03-26 16:15:46.619381006 -0400 -+++ ndctl-56/Documentation/ndctl-create-namespace.txt 2017-05-24 15:03:41.711314927 -0400 -@@ -93,7 +93,7 @@ OPTIONS - Applications that want to establish DAX memory mappings - with page table entries greater than 4K in size need a - persistent memory namespace that is sufficiently aligned. For -- "memory" and "dax" mode this defaults to 2M. Note that "dax" -+ "memory" and "dax" mode this defaults to 4K. Note that "dax" - mode enforces all mappings to be aligned to this value, - i.e. fails unaligned mapping attempts. - diff --git a/SOURCES/rhel-ndctl-limit-device-dax-to-4k-by-default.patch b/SOURCES/rhel-ndctl-limit-device-dax-to-4k-by-default.patch deleted file mode 100644 index 4339ccb..0000000 --- a/SOURCES/rhel-ndctl-limit-device-dax-to-4k-by-default.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -upr ndctl-56.vanilla/ndctl/builtin-xaction-namespace.c ndctl-56/ndctl/builtin-xaction-namespace.c ---- ndctl-56.vanilla/ndctl/builtin-xaction-namespace.c 2017-03-26 16:15:54.957274589 -0400 -+++ ndctl-56/ndctl/builtin-xaction-namespace.c 2017-03-26 16:16:32.671793238 -0400 -@@ -213,7 +213,7 @@ static int set_defaults(enum namespace_a - param.align); - rc = -EINVAL; - } else if (!param.align) { -- param.align = "2M"; -+ param.align = "4K"; - param.align_default = true; - } - -Only in ndctl-56/ndctl: builtin-xaction-namespace.c.orig diff --git a/SPECS/ndctl.spec b/SPECS/ndctl.spec index e3b1795..6e43507 100644 --- a/SPECS/ndctl.spec +++ b/SPECS/ndctl.spec @@ -1,16 +1,16 @@ Name: ndctl -Version: 56 -Release: 2%{?dist} +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: 22bffbe-daxctl-add-libuuid-to-the-build.patch -Patch1: 77d84b2-ndctl-create-namespace-include-dax-info-in-operation-result.patch -Patch2: rhel-ndctl-limit-device-dax-to-4k-by-default.patch -Patch3: rhel-ndctl-document-4k-alignment-default.patch -Patch4: 2cf2acc-libndctl-add-support-for-the-MSFT-family-of-DSM-functions.patch +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,6 +25,9 @@ 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" @@ -100,7 +103,11 @@ control API for these devices. %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 @@ -155,6 +162,23 @@ make check %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