diff --git a/.gitignore b/.gitignore index ddd9229..5212f62 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/v1.9.tar.gz +SOURCES/v1.10.1.tar.gz diff --git a/.nvme-cli.metadata b/.nvme-cli.metadata index c9775d8..a3806f9 100644 --- a/.nvme-cli.metadata +++ b/.nvme-cli.metadata @@ -1 +1 @@ -e3604335030f745be0a7276c4f9064e31916714e SOURCES/v1.9.tar.gz +b312f3385742cc8a171379dd10b3397b45462eca SOURCES/v1.10.1.tar.gz diff --git a/SOURCES/fix-systemd-service-script-use-connect-args-patch b/SOURCES/fix-systemd-service-script-use-connect-args-patch deleted file mode 100644 index 1af4f2b..0000000 --- a/SOURCES/fix-systemd-service-script-use-connect-args-patch +++ /dev/null @@ -1,24 +0,0 @@ -commit 57315578d9e500dae5143dbda607dcadc933c545 -Author: James Smart -Date: Tue Jan 7 10:02:57 2020 -0700 - - Fix systemd service script use of CONNECT_ARGS env var - - In testing, some environments are not properly expanding CONNECT_ARGS. - - Change systemd service file use of CONNECT_ARGS to be encapsulated by - apostrophes and parens. - - Signed-off-by: James Smart - Signed-off-by: Keith Busch - -diff --git a/nvmf-autoconnect/systemd/nvmf-connect@.service b/nvmf-autoconnect/systemd/nvmf-connect@.service -index 10fb3aa..c60f146 100644 ---- a/nvmf-autoconnect/systemd/nvmf-connect@.service -+++ b/nvmf-autoconnect/systemd/nvmf-connect@.service -@@ -11,4 +11,4 @@ Requires=nvmf-connect.target - [Service] - Type=simple - Environment="CONNECT_ARGS=%i" --ExecStart=/bin/sh -c "nvme connect-all --quiet `/bin/echo -e $CONNECT_ARGS`" -+ExecStart=/bin/sh -c "nvme connect-all --quiet `/bin/echo -e '${CONNECT_ARGS}'`" diff --git a/SOURCES/nvme-cli-add-addl-smart-log-crit-warn-decoding-patch b/SOURCES/nvme-cli-add-addl-smart-log-crit-warn-decoding-patch new file mode 100644 index 0000000..8198c90 --- /dev/null +++ b/SOURCES/nvme-cli-add-addl-smart-log-crit-warn-decoding-patch @@ -0,0 +1,128 @@ +commit 4bad11866a349b7ae5d10869474f7c0fee740845 +Author: Wen Xiong +Date: Wed Jan 8 12:24:41 2020 -0800 + + Add additional smart log critical warn decoding + + Provide a user option to request additional smart log page decoding, + and print out detailed critical warning when requested. + + Signed-off-by: Wendy Xiong + [merge up, rename json keys] + Signed-off-by: Keith Busch + +diff --git a/nvme-print.c b/nvme-print.c +index 2ba1de1..46d5228 100644 +--- a/nvme-print.c ++++ b/nvme-print.c +@@ -585,10 +585,11 @@ static void json_endurance_log(struct nvme_endurance_group_log *endurance_group, + json_free_object(root); + } + +-static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid) ++static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, ++ enum nvme_print_flags flags) + { ++ int c, human = flags & VERBOSE; + struct json_object *root; +- int c; + char key[21]; + + unsigned int temperature = ((smart->temperature[1] << 8) | +@@ -607,8 +608,22 @@ static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid) + + root = json_create_object(); + +- json_object_add_value_int(root, "critical_warning", +- smart->critical_warning); ++ if (human) { ++ struct json_object *crt = json_create_object(); ++ ++ json_object_add_value_int(crt, "value", smart->critical_warning); ++ json_object_add_value_int(crt, "available_spare", smart->critical_warning & 0x01); ++ json_object_add_value_int(crt, "temp_threshold", (smart->critical_warning & 0x02) >> 1); ++ json_object_add_value_int(crt, "reliability_degraded", (smart->critical_warning & 0x04) >> 2); ++ json_object_add_value_int(crt, "ro", (smart->critical_warning & 0x08) >> 3); ++ json_object_add_value_int(crt, "vmbu_failed", (smart->critical_warning & 0x10) >> 4); ++ json_object_add_value_int(crt, "pmr_ro", (smart->critical_warning & 0x20) >> 5); ++ ++ json_object_add_value_object(root, "critical_warning", crt); ++ } else ++ json_object_add_value_int(root, "critical_warning", ++ smart->critical_warning); ++ + json_object_add_value_int(root, "temperature", temperature); + json_object_add_value_int(root, "avail_spare", smart->avail_spare); + json_object_add_value_int(root, "spare_thresh", smart->spare_thresh); +@@ -3400,16 +3415,26 @@ void nvme_show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, + /* convert temperature from Kelvin to Celsius */ + int temperature = ((smart->temperature[1] << 8) | + smart->temperature[0]) - 273; +- int i; ++ int i, human = flags & VERBOSE; + + if (flags & BINARY) + return d_raw((unsigned char *)smart, sizeof(*smart)); + else if (flags & JSON) +- return json_smart_log(smart, nsid); ++ return json_smart_log(smart, nsid, flags); + + printf("Smart Log for NVME device:%s namespace-id:%x\n", devname, nsid); + printf("critical_warning : %#x\n", + smart->critical_warning); ++ ++ if (human) { ++ printf(" Available Spare[0] : %d\n", smart->critical_warning & 0x01); ++ printf(" Temp. Threshold[1] : %d\n", (smart->critical_warning & 0x02) >> 1); ++ printf(" NVM subsystem Reliability[2] : %d\n", (smart->critical_warning & 0x04) >> 2); ++ printf(" Read-only[3] : %d\n", (smart->critical_warning & 0x08) >> 3); ++ printf(" Volatile mem. backup failed[4] : %d\n", (smart->critical_warning & 0x10) >> 4); ++ printf(" Persistent Mem. RO[5] : %d\n", (smart->critical_warning & 0x20) >> 5); ++ } ++ + printf("temperature : %d C\n", + temperature); + printf("available_spare : %u%%\n", +diff --git a/nvme.c b/nvme.c +index 3b386bc..dd3ab58 100644 +--- a/nvme.c ++++ b/nvme.c +@@ -218,6 +218,7 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug + "(default) or binary."; + const char *namespace = "(optional) desired namespace"; + const char *raw = "output in binary format"; ++ const char *human_readable = "show info in readable format"; + enum nvme_print_flags flags; + int err, fd; + +@@ -225,6 +226,7 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug + __u32 namespace_id; + int raw_binary; + char *output_format; ++ int human_readable; + }; + + struct config cfg = { +@@ -234,9 +236,10 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug + + + OPT_ARGS(opts) = { +- OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace), +- OPT_FMT("output-format", 'o', &cfg.output_format, output_format), +- OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw), ++ OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace), ++ OPT_FMT("output-format", 'o', &cfg.output_format, output_format), ++ OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw), ++ OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable), + OPT_END() + }; + +@@ -249,6 +252,8 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug + goto close_fd; + if (cfg.raw_binary) + flags = BINARY; ++ if (cfg.human_readable) ++ flags |= VERBOSE; + + err = nvme_smart_log(fd, cfg.namespace_id, &smart_log); + if (!err) diff --git a/SOURCES/nvme-cli-check-sysfs-interface-before-nvme-disc-patch b/SOURCES/nvme-cli-check-sysfs-interface-before-nvme-disc-patch deleted file mode 100644 index 55e2932..0000000 --- a/SOURCES/nvme-cli-check-sysfs-interface-before-nvme-disc-patch +++ /dev/null @@ -1,22 +0,0 @@ -commit ca9a2ec103003d1377c45d49452c457194ad27db -Author: Simon Schricker -Date: Fri Nov 29 10:52:05 2019 +0100 - - nvme-cli: Check for sysfs interface before NVMe discovery - - This prevents an unnecessary error message in the case that the nvme-fc - kernel module is not loaded and the - /sys/class/fc/fc_udev_device/nvme_discovery - handle is not available. - -diff --git a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service -index 84f6486..33ab8c1 100644 ---- a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service -+++ b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service -@@ -1,5 +1,6 @@ - [Unit] - Description=Auto-connect to subsystems on FC-NVME devices found during boot -+ConditionPathExists=/sys/class/fc/fc_udev_device/nvme_discovery - - [Service] - Type=oneshot diff --git a/SOURCES/nvme-cli-memblaze-change-mode-patch b/SOURCES/nvme-cli-memblaze-change-mode-patch new file mode 100644 index 0000000..5967c4a --- /dev/null +++ b/SOURCES/nvme-cli-memblaze-change-mode-patch @@ -0,0 +1,16 @@ +commit 27cc5431f4aabdc8fea8b371c18b3ec1f6b9235b +Author: Yi Zhang +Date: Thu Jan 16 15:56:58 2020 +0800 + + nvme-cli: memblaze: change to 100644 mode for memblaze-nvme.c + + Bellow WARNING observed with rpmbuild -bb rpmbuild/SPECS/nvme-cli.spec + *** WARNING: plugins/memblaze/memblaze-nvme.c is executable but has + empty or no shebang, removing executable bit + + Signed-off-by: Yi Zhang + Signed-off-by: Keith Busch + +diff --git a/plugins/memblaze/memblaze-nvme.c b/plugins/memblaze/memblaze-nvme.c +old mode 100755 +new mode 100644 diff --git a/SOURCES/nvmf-autoconnect-add-udev-rules-to-set-iopolicy-netapp-patch b/SOURCES/nvmf-autoconnect-add-udev-rules-to-set-iopolicy-netapp-patch deleted file mode 100644 index f5eb19b..0000000 --- a/SOURCES/nvmf-autoconnect-add-udev-rules-to-set-iopolicy-netapp-patch +++ /dev/null @@ -1,15 +0,0 @@ -commit 6eafcf96f315d6ae7be5fa8332131c4cc487d5df -Author: Simon Schricker -Date: Tue Dec 17 10:49:35 2019 +0100 - - nvmf-autoconnect: add udev rules to set iopolicy for certain NetApp devices - -diff --git a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules b/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules -new file mode 100644 -index 0000000..aefd9d4 ---- /dev/null -+++ b/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules -@@ -0,0 +1,3 @@ -+# Enable round-robin for NetApp ONTAP and NetApp E-Series -+ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="round-robin" -+ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{model}=="NetApp E-Series", ATTR{iopolicy}="round-robin" diff --git a/SOURCES/nvmf-autoconnect-fix-abls-path-systemctl-patch b/SOURCES/nvmf-autoconnect-fix-abls-path-systemctl-patch deleted file mode 100644 index af2c88d..0000000 --- a/SOURCES/nvmf-autoconnect-fix-abls-path-systemctl-patch +++ /dev/null @@ -1,27 +0,0 @@ -commit 177d12ec112ab370d91b7129a33d2da43b809203 -Author: Sagi Grimberg -Date: Thu Aug 22 15:09:36 2019 -0700 - - nvmf-autoconnect: fix absolute path for systemctl - - Without the absolute path udev gets the error: - failed to execute '/lib/udev/systemctl' 'systemctl --no-block start nvmf-connect@[...].service': No such file or directory - - Signed-off-by: Sagi Grimberg - -diff --git a/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules b/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules -index 789a2c8..c909fb0 100644 ---- a/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules -+++ b/nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules -@@ -9,9 +9,9 @@ - ACTION=="change", SUBSYSTEM=="nvme", ENV{NVME_EVENT}=="discovery",\ - ENV{NVME_CTRL_NAME}=="*", ENV{NVME_TRTYPE}=="*", ENV{NVME_TRADDR}=="*", \ - ENV{NVME_TRSVCID}=="*", ENV{NVME_HOST_TRADDR}=="*", \ -- RUN+="systemctl --no-block start nvmf-connect@--device=$env{NVME_CTRL_NAME}\t--transport=$env{NVME_TRTYPE}\t--traddr=$env{NVME_TRADDR}\t--trsvcid=$env{NVME_TRSVCID}\t--host-traddr=$env{NVME_HOST_TRADDR}.service" -+ RUN+="/bin/systemctl --no-block start nvmf-connect@--device=$env{NVME_CTRL_NAME}\t--transport=$env{NVME_TRTYPE}\t--traddr=$env{NVME_TRADDR}\t--trsvcid=$env{NVME_TRSVCID}\t--host-traddr=$env{NVME_HOST_TRADDR}.service" - - # nvme-fc transport generated events (old-style for compatibility) - ACTION=="change", SUBSYSTEM=="fc", ENV{FC_EVENT}=="nvmediscovery", \ - ENV{NVMEFC_HOST_TRADDR}=="*", ENV{NVMEFC_TRADDR}=="*", \ -- RUN+="systemctl --no-block start nvmf-connect@--device=none\t--transport=fc\t--traddr=$env{NVMEFC_TRADDR}\t--trsvcid=none\t--host-traddr=$env{NVMEFC_HOST_TRADDR}.service" -+ RUN+="/bin/systemctl --no-block start nvmf-connect@--device=none\t--transport=fc\t--traddr=$env{NVMEFC_TRADDR}\t--trsvcid=none\t--host-traddr=$env{NVMEFC_HOST_TRADDR}.service" diff --git a/SOURCES/systemd-fix-echo-call-with-absolute-path-patch b/SOURCES/systemd-fix-echo-call-with-absolute-path-patch deleted file mode 100644 index 0ddc6a7..0000000 --- a/SOURCES/systemd-fix-echo-call-with-absolute-path-patch +++ /dev/null @@ -1,59 +0,0 @@ -commit 0451499b82813b6aefa30519bdd26459a6dd7c58 -Author: Sagi Grimberg -Date: Thu Aug 22 15:09:37 2019 -0700 - - systemd: fix echo call with absolute path - - Without placing the absolute path when formatting the - nvme connect-all args we can get the following error: - -- - connect-all: unrecognized option '-e' - Discover NVMeoF subsystems and connect to them [ --transport=, -t ] --- transport type - [ --traddr=, -a ] --- transport address - [ --trsvcid=, -s ] --- transport service id (e.g. IP - port) - [ --host-traddr=, -w ] --- host traddr (e.g. FC WWN's) - [ --hostnqn=, -q ] --- user-defined hostnqn (if default - not used) - [ --hostid=, -I ] --- user-defined hostid (if default - not used) - [ --raw=, -r ] --- raw output file - [ --device=, -d ] --- use existing discovery controller - device - [ --keep-alive-tmo=, -k ] --- keep alive timeout period in - seconds - [ --reconnect-delay=, -c ] --- reconnect timeout period in - seconds - [ --ctrl-loss-tmo=, -l ] --- controller loss timeout period in - seconds - [ --hdr_digest, -g ] --- enable transport protocol header - digest (TCP transport) - [ --data_digest, -G ] --- enable transport protocol data - digest (TCP transport) - [ --nr-io-queues=, -i ] --- number of io queues to use - (default is core count) - [ --nr-write-queues=, -W ] --- number of write queues to use - (default 0) - [ --nr-poll-queues=, -P ] --- number of poll queues to use - (default 0) - [ --queue-size=, -Q ] --- number of io queue elements to - use (default 128) - [ --persistent, -p ] --- persistent discovery connection - [ --quiet, -Q ] --- suppress already connected errors - Usage: nvme connect-all [OPTIONS] - Options: - : nvmf-connect@--device\x3dnvme0\t--transport\x3dtcp\t--traddr\x3d192.168.123.1\t--trsvcid\x3d8009\t--host-traddr\x3dnone.service: Main process exited, code=exited, status=70/n/a - : nvmf-connect@--device\x3dnvme0\t--transport\x3dtcp\t--traddr\x3d192.168.123.1\t--trsvcid\x3d8009\t--host-traddr\x3dnone.service: Failed with result 'exit-code'. - - Signed-off-by: Sagi Grimberg - -diff --git a/nvmf-autoconnect/systemd/nvmf-connect@.service b/nvmf-autoconnect/systemd/nvmf-connect@.service -index 25dca0e..10fb3aa 100644 ---- a/nvmf-autoconnect/systemd/nvmf-connect@.service -+++ b/nvmf-autoconnect/systemd/nvmf-connect@.service -@@ -11,4 +11,4 @@ Requires=nvmf-connect.target - [Service] - Type=simple - Environment="CONNECT_ARGS=%i" --ExecStart=/bin/sh -c "nvme connect-all --quiet `echo -e $CONNECT_ARGS`" -+ExecStart=/bin/sh -c "nvme connect-all --quiet `/bin/echo -e $CONNECT_ARGS`" diff --git a/SPECS/nvme-cli.spec b/SPECS/nvme-cli.spec index af26392..163a0dd 100644 --- a/SPECS/nvme-cli.spec +++ b/SPECS/nvme-cli.spec @@ -2,8 +2,8 @@ #%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7}) Name: nvme-cli -Version: 1.9 -Release: 5%{?dist} +Version: 1.10.1 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPLv2+ @@ -11,15 +11,12 @@ URL: https://github.com/linux-nvme/nvme-cli #Source0: https://github.com/linux-nvme/%%{name}/archive/%%{commit0}.tar.gz Source0: https://github.com/linux-nvme/%{name}/archive/v%{version}.tar.gz -Patch0: nvmf-autoconnect-fix-abls-path-systemctl-patch -Patch1: systemd-fix-echo-call-with-absolute-path-patch -Patch2: nvme-cli-check-sysfs-interface-before-nvme-disc-patch -Patch3: nvmf-autoconnect-add-udev-rules-to-set-iopolicy-netapp-patch -Patch4: fix-systemd-service-script-use-connect-args-patch +Patch0: nvme-cli-memblaze-change-mode-patch +Patch1: nvme-cli-add-addl-smart-log-crit-warn-decoding-patch BuildRequires: libuuid-devel BuildRequires: gcc -BuildRequires: systemd +BuildRequires: systemd-devel %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -29,9 +26,7 @@ nvme-cli provides NVM-Express user space tooling for Linux. %setup -q %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 + %build @@ -47,8 +42,8 @@ mkdir -p %{buildroot}%{_sysconfdir}/nvme # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. -# rm -f %{buildroot}%{_sysconfdir}/nvme/hostid -# rm -f %{buildroot}%{_sysconfdir}/nvme/hostnqn +#rm -f %{buildroot}%{_sysconfdir}/nvme/hostid +#rm -f %{buildroot}%{_sysconfdir}/nvme/hostnqn # Do not install the dracut rule yet. See rhbz 1742764 rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf @@ -70,26 +65,27 @@ rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %{_unitdir}/nvmf-connect@.service %{_udevrulesdir}/70-nvmf-autoconnect.rules %{_udevrulesdir}/71-nvmf-iopolicy-netapp.rules - # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf + %post if [ $1 -eq 1 ]; then # 1 : This package is being installed for the first time - if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then echo $(nvme gen-hostnqn) > %{_sysconfdir}/nvme/hostnqn - fi - if [ ! -s %{_sysconfdir}/nvme/hostid ]; then uuidgen > %{_sysconfdir}/nvme/hostid - fi # apply udev and systemd changes that we did systemctl enable nvmefc-boot-connections systemctl daemon-reload udevadm control --reload-rules && udevadm trigger fi - %changelog +* Thu Mar 19 2020 luto@kernel.org - 1.10.1-1 +- Update to 1.10.1 + +* Wed Jan 29 2020 Fedora Release Engineering - 1.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Wed Oct 02 2019 luto@kernel.org - 1.9-1 - Update to 1.9 - Certain fabric functionality may not work yet due to missing dracut