parent
8ae2ee7859
commit
488ec4b60d
@ -0,0 +1,54 @@
|
||||
From 006aca565d4c8565baf05296b8e65ca4d5f203d3 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Fri, 30 Jul 2021 13:22:54 +0200
|
||||
Subject: wdctl: Workaround reported boot-status bits not being present in
|
||||
wd->ident.options
|
||||
|
||||
Some watchdog drivers are capable of reporting WDIOF_CARDRESET in their
|
||||
bootstatus, but they do not advertise this in the options field
|
||||
returned by the WDIOC_GETSUPPORT ioctl.
|
||||
|
||||
This causes wdctl to not print the CARDRESET flag on these devices,
|
||||
even when the reset was caused by the watchdog and this is being
|
||||
reported in the WDIOC_GETBOOTSTATUS return.
|
||||
|
||||
Add a workaround by or-ing any bits which are set in the status and
|
||||
bstatus returns into wd->ident.options so that reported flags will
|
||||
get printend independent of them being advertised as supported in
|
||||
wd->ident.options.
|
||||
|
||||
This will make wdctl print a CARDRESET line when the system was
|
||||
actually reset by the watchdog while omitting it when it was not
|
||||
reset by the watchdog. At least on drivers which have the
|
||||
CARDRESET is missing from info.options problem. On other drivers
|
||||
the CARDRESET line will always be printend, but the actual reported
|
||||
value will change.
|
||||
|
||||
Upstream: http://github.com/util-linux/util-linux/commit/b1b0259fe42aad1bf0997ce1c03a020ce59e38ab
|
||||
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2057046
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
sys-utils/wdctl.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c
|
||||
index 8de5d5a2d..6b9affa0a 100644
|
||||
--- a/sys-utils/wdctl.c
|
||||
+++ b/sys-utils/wdctl.c
|
||||
@@ -419,6 +419,13 @@ static int read_watchdog_from_device(struct wd_device *wd)
|
||||
ioctl(fd, WDIOC_GETSTATUS, &wd->status);
|
||||
ioctl(fd, WDIOC_GETBOOTSTATUS, &wd->bstatus);
|
||||
|
||||
+ /*
|
||||
+ * Sometimes supported options like WDIOF_CARDRESET are missing from
|
||||
+ * ident.options, add anything set in status/bstatus to ident.options.
|
||||
+ */
|
||||
+ wd->ident.options |= wd->status;
|
||||
+ wd->ident.options |= wd->bstatus;
|
||||
+
|
||||
if (ioctl(fd, WDIOC_GETTIMEOUT, &wd->timeout) >= 0)
|
||||
wd->has_timeout = 1;
|
||||
if (ioctl(fd, WDIOC_GETPRETIMEOUT, &wd->pretimeout) >= 0)
|
||||
--
|
||||
2.34.1
|
||||
|
@ -2,7 +2,7 @@
|
||||
Summary: A collection of basic system utilities
|
||||
Name: util-linux
|
||||
Version: 2.37.4
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
|
||||
URL: http://en.wikipedia.org/wiki/Util-linux
|
||||
|
||||
@ -109,6 +109,8 @@ Patch6: 0006-uuidd-fix-open-lock-state-issue.patch
|
||||
Patch7: 0007-sysfs-fallback-for-partitions-not-including-parent-n.patch
|
||||
# 2033622 - logger from util-linux incorrectly handles long messages
|
||||
Patch8: 0008-logger-fix-size-use-for-stdin.patch
|
||||
# 2057046 - wdctl not picking up reboot reason flag
|
||||
Patch9: 0009-wdctl-Workaround-reported-boot-status-bits-not-being.patch
|
||||
|
||||
|
||||
%description
|
||||
@ -942,8 +944,11 @@ fi
|
||||
%{_libdir}/python*/site-packages/libmount/
|
||||
|
||||
%changelog
|
||||
* Thu Feb 24 2022 Karel Zak <kzak@redhat.com> 2.37.4-3
|
||||
- fix #2057046 - wdctl not picking up reboot reason flag
|
||||
|
||||
* Thu Feb 17 2022 Karel Zak <kzak@redhat.com> 2.37.4-2
|
||||
* improve bugfix for #2047952, fix warnings from rpminspect
|
||||
- improve bugfix for #2047952, fix warnings from rpminspect
|
||||
|
||||
* Wed Feb 16 2022 Karel Zak <kzak@redhat.com> 2.37.4-1
|
||||
- upgrade to v2.37.4 (fix CVE-2022-0563)
|
||||
|
Loading…
Reference in New Issue
Block a user