Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3ae8adce928d4ce6ef36c…
Commit: 3ae8adce928d4ce6ef36c87c2a0bb8aa737346b8
Parent: 9940c2f754e3292b6d96628682c254941ae6cc58
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 5 10:16:20 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 5 10:23:20 2017 +0200
fsadm: add --help
Newer version of blockdev tool needs --help as the tool is no longer
printing help without this option like it used to in past.
---
WHATS_NEW | 1 +
scripts/fsadm.sh | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index b2037a6..0cdd398 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.175 -
======================================
+ Use --help with blockdev when checking for --getsize64 support in fsadm.
Fix metadata corruption in vgsplit intermediate state.
Require LV name with pvmove in a shared VG.
Allow shared active mirror LVs with lvmlockd, dlm, and cmirrord.
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 459905f..753da2b 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -365,7 +365,7 @@ detect_mounted() {
# get the full size of device in bytes
detect_device_size() {
# check if blockdev supports getsize64
- "$BLOCKDEV" 2>&1 | "$GREP" getsize64 >"$NULL"
+ "$BLOCKDEV" --help 2>&1 | "$GREP" getsize64 >"$NULL"
if test $? -eq 0; then
DEVSIZE=$("$BLOCKDEV" --getsize64 "$VOLUME")
test -n "$DEVSIZE" || error "Cannot read size of device \"$VOLUME\"."
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9940c2f754e3292b6d966…
Commit: 9940c2f754e3292b6d96628682c254941ae6cc58
Parent: a95f656d0df0fb81d68fa27bfee2350953677174
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 4 13:58:21 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 5 10:19:21 2017 +0200
dmeventd: schedule exit on break
When dmeventd receives SIGTERM/INT/HUP/QUIT it validates if exit is possible.
If there was any device still monitored, such exit request used to
be ignored/refused. This 'usually' worked reasonably well, however if there
is very short time period between last device is unmonitored and signal
reception - there was possibility such EXIT was ignored, as dmeventd has
not yet got into idle state even commands like 'vgchange -an' has already
finished.
This patch changes logic towards scheduling EXIT to the nearest
point when there is no monitored device.
EXIT is never forgotten.
NOTE: if there is only a single monitored device and someone sends
SIGTERM and later someone uses i.e. 'lvchange --refresh' after
unmonitoring dmeventd will exit and new instance needs to be
started.
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/dmeventd.c | 13 ++++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 5a11e2e..ea01089 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.144 -
======================================
+ Schedule exit when received SIGTERM in dmeventd.
Also try to unmount /boot on blkdeactivate -u if on top of supported device.
Use blkdeactivate -r wait in blk-availability systemd service/initscript.
Add blkdeactivate -r wait option to wait for MD resync/recovery/reshape.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 3a92ab6..cc520d3 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -62,6 +62,8 @@
#include <syslog.h>
+#define DM_SIGNALED_EXIT 1
+#define DM_SCHEDULED_EXIT 2
static volatile sig_atomic_t _exit_now = 0; /* set to '1' when signal is given to exit */
/* List (un)link macros. */
@@ -1750,7 +1752,7 @@ static void _init_thread_signals(void)
*/
static void _exit_handler(int sig __attribute__((unused)))
{
- _exit_now = 1;
+ _exit_now = DM_SIGNALED_EXIT;
}
#ifdef __linux__
@@ -2248,6 +2250,8 @@ int main(int argc, char *argv[])
for (;;) {
if (_idle_since) {
if (_exit_now) {
+ if (_exit_now == DM_SCHEDULED_EXIT)
+ break; /* Only prints shutdown message */
log_info("dmeventd detected break while being idle "
"for %ld second(s), exiting.",
(long) (time(NULL) - _idle_since));
@@ -2264,15 +2268,14 @@ int main(int argc, char *argv[])
break;
}
}
- } else if (_exit_now) {
- _exit_now = 0;
+ } else if (_exit_now == DM_SIGNALED_EXIT) {
+ _exit_now = DM_SCHEDULED_EXIT;
/*
* When '_exit_now' is set, signal has been received,
* but can not simply exit unless all
* threads are done processing.
*/
- log_warn("WARNING: There are still devices being monitored.");
- log_warn("WARNING: Refusing to exit.");
+ log_info("dmeventd received break, scheduling exit.");
}
_process_request(&fifos);
_cleanup_unused_threads();