From 0dfa332453f52f68786d6929a3b8fc55c1028107 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 2 Jul 2026 12:22:00 +0200 Subject: [PATCH] fix pending count output breaking json format (RHEL-187979) Resolves: RHEL-187979 --- smartmontools-7.2-json-pending-count.patch | 12 ++++++++++++ smartmontools.spec | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 smartmontools-7.2-json-pending-count.patch diff --git a/smartmontools-7.2-json-pending-count.patch b/smartmontools-7.2-json-pending-count.patch new file mode 100644 index 0000000..65d308a --- /dev/null +++ b/smartmontools-7.2-json-pending-count.patch @@ -0,0 +1,12 @@ +diff -up smartmontools-7.2/scsiprint.cpp.json-pending-count smartmontools-7.2/scsiprint.cpp +--- smartmontools-7.2/scsiprint.cpp.json-pending-count 2026-07-02 12:17:45.577756287 +0200 ++++ smartmontools-7.2/scsiprint.cpp 2026-07-02 12:17:45.586493308 +0200 +@@ -523,7 +523,7 @@ scsiPrintPendingDefectsLPage(scsi_device + uint32_t count; + switch (pc) { + case 0x0: +- printf(" Pending defect count:"); ++ jout(" Pending defect count:"); + if ((pl < 8) || (num < 8)) { + print_on(); + pout("%s truncated descriptor\n", pDefStr); diff --git a/smartmontools.spec b/smartmontools.spec index 9475ee3..1d29735 100644 --- a/smartmontools.spec +++ b/smartmontools.spec @@ -1,7 +1,7 @@ Summary: Tools for monitoring SMART capable hard disks Name: smartmontools Version: 7.2 -Release: 10%{?dist} +Release: 11%{?dist} Epoch: 1 License: GPLv2+ URL: http://smartmontools.sourceforge.net/ @@ -24,6 +24,9 @@ Patch5: smartmontools-7.2-r5448.patch # from upstream, for <= 7.4, #RHEL-15505 Patch6: smartmontools-7.2-fixfdclose.patch +# from upstream, for <= 7.3, RHEL-187979 +# https://github.com/smartmontools/smartmontools/commit/5689dea0d77713c984188db9cf6b8377081b880f +Patch7: smartmontools-7.2-json-pending-count.patch BuildRequires: make BuildRequires: gcc-c++ readline-devel ncurses-devel automake util-linux groff gettext @@ -49,6 +52,7 @@ failure. %patch -P 4 -p2 -b .logsuppagefix3 %patch -P 5 -p1 -b .r5448 %patch -P 6 -p1 -b .fixfdclose +%patch -P 7 -p1 -b .json-pending-count cp %{SOURCE5} . %build @@ -105,6 +109,9 @@ mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/%{name} %{_sharedstatedir}/%{name} %changelog +* Thu Jul 02 2026 Michal Hlavinka - 1:7.2-11 +- fix pending count output breaking json format (RHEL-187979) + * Mon Dec 08 2025 Michal Hlavinka - 1:7.2-10 - use tmpfiles.d to create /var/lib/smartmontools (RHEL-132500)