Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=61358d92cbf202dbb483d…
Commit: 61358d92cbf202dbb483d63a63d5adf0463bb934
Parent: 5d6bf1efb225b964bfff398277e68345acdac1d0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 25 17:22:49 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 30 13:39:44 2019 +0200
lvmetad: fix timeout on shutdown
When lvmetad is going to be shutdown - there were 2 issue:
If there was endless stream of command contacting lvmetad - the process
would never finish - so now when we recieved SIGTERM - we are no longer
accepting new connections and we just wait till the existing ones are
finished.
2nd. issue is that actually when we are waiting for finish of all client
threads - we basically want an usleep() and check if all threads
are already finished - proper solution would be to singal from a thread
there is some work to do for master thread - but that would be a bigger
change and since lvmetad is no longer developed - keep the change
minimal and just use pselect() as our '1sec.' sleeping call once
we are in 'shutdown' mode.
Reported-by: wangjufeng(a)huawei.com
---
WHATS_NEW | 1 +
libdaemon/server/daemon-server.c | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3811c5c..80ba83d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.187 -
===================================
+ Fix lvmetad shutdown and avoid lenghty timeouts when rebooting system.
Prevent creating VGs with PVs with different logical block sizes.
Pvmove runs in exlusively activating mode for exclusively active LVs.
Activate thin-pool layered volume as 'read-only' device.
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index bc58f7b..62f403a 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -89,6 +89,13 @@ static int _is_idle(daemon_state s)
static struct timespec *_get_timeout(daemon_state s)
{
+ static struct timespec _tm = { 0 };
+
+ if (_shutdown_requested) {
+ _tm.tv_sec = 1;
+ return &_tm;
+ }
+
return s.idle ? s.idle->ptimeout : NULL;
}
@@ -506,7 +513,7 @@ static int _handle_connect(daemon_state s)
socklen_t sl = sizeof(sockaddr);
client.socket_fd = accept(s.socket_fd, (struct sockaddr *) &sockaddr, &sl);
- if (client.socket_fd < 0) {
+ if (client.socket_fd < 0 || _shutdown_requested) {
if (errno != EAGAIN || !_shutdown_requested)
ERROR(&s, "Failed to accept connection: %s.", strerror(errno));
return 0;
@@ -672,7 +679,7 @@ void daemon_start(daemon_state s)
continue;
}
- if (FD_ISSET(s.socket_fd, &in)) {
+ if (!_shutdown_requested && FD_ISSET(s.socket_fd, &in)) {
timeout_count = 0;
_handle_connect(s);
}
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a98b77c16455ee97f5bd4…
Commit: a98b77c16455ee97f5bd4b89536a3ae4efd8e009
Parent: c813db8fc2ec15a8370bb291f662e15ba26682e8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 30 13:25:42 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 30 13:34:34 2019 +0200
vdo: properly check percentage for resize
Avoid checking 'lv_is_active()' since special LV types does this
validation anyway what calling _percent() function and call it
ONLY when none of special types is queried.
This restores support for VDO resize (as with support for
separate VDO pool activation, plain query for lv_is_active()
is not working in this case).
---
lib/metadata/lv_manip.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 21d21ca..47ff167 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4850,12 +4850,6 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv,
return 0;
}
- if (!lv_is_active(lv)) {
- log_error("Can't read state of locally inactive LV %s.",
- display_lvname(lv));
- return 0;
- }
-
if (lv_is_thin_pool(lv)) {
if (!lv_thin_pool_percent(lv, 1, &percent))
return_0;
@@ -4870,9 +4864,12 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv,
} else if (lv_is_vdo_pool(lv)) {
if (!lv_vdo_pool_percent(lv, &percent))
return_0;
- } else {
- if (!lv_snapshot_percent(lv, &percent))
+ } else if (!lv_snapshot_percent(lv, &percent))
return_0;
+ else if (!lv_is_active(lv)) {
+ log_error("Can't read state of locally inactive LV %s.",
+ display_lvname(lv));
+ return 0;
}
*amount = _adjust_amount(percent, policy_threshold, policy_amount);
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c813db8fc2ec15a8370bb…
Commit: c813db8fc2ec15a8370bb291f662e15ba26682e8
Parent: fd5b8b72da79e2f0a10785d055a27643d9eaaf19
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 30 13:22:42 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 30 13:34:34 2019 +0200
vdo: deactivate forgotten vdo pool
If the linear mapping is lost (for whatever reason, i.e.
test suite forcible 'dmsetup remove' linear LV,
lvm2 had hard times figuring out how to deactivate such DM table.
So add function which is in case inactive VDO pool LV checks if
the pool is actually still active (-vpool device present) and
it has open count == 0. In this case deactivation is allowed
to continue and cleanup DM table.
---
lib/activate/activate.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 29cd2d3..2588816 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -2434,6 +2434,17 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi
}
}
+ if (lv_is_vdo_pool(lv)) {
+ /* If someone has remove 'linear' mapping over VDO device
+ * we may still be able to deactivate the rest of the tree
+ * i.e. in test-suite we simulate this via 'dmsetup remove' */
+ if (!lv_info(cmd, lv, 1, &info, 1, 0))
+ goto_out;
+
+ if (info.exists && !info.open_count)
+ r = 0; /* Unused VDO device left in table? */
+ }
+
if (r)
goto out;
}
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=dc3f0e067d2f402853551…
Commit: dc3f0e067d2f402853551142bc917dc9c070d499
Parent: 9a8e6ad014c7dd6785ad6859551d68a264bad1f8
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Sep 25 08:27:49 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Sep 25 08:27:49 2019 +0200
build: make generate
---
man/lvchange.8_pregen | 4 +++-
man/lvconvert.8_pregen | 39 +++++++++++++++++++++++++++++++++++++++
man/pvscan.8_pregen | 13 +++++++++++++
3 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/man/lvchange.8_pregen b/man/lvchange.8_pregen
index 110dd91..51172f2 100644
--- a/man/lvchange.8_pregen
+++ b/man/lvchange.8_pregen
@@ -360,7 +360,9 @@ required, after which the others are optional.
.br
-
-Resyncronize a mirror or raid LV.
+Resyncronize a mirror or raid LV.
+.br
+Use to reset 'R' attribute on a not initially synchronized LV.
.br
.P
\fBlvchange\fP \fB--resync\fP \fIVG\fP|\fILV\fP\fI_mirror_raid\fP|\fITag\fP|\fISelect\fP ...
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index 846ea2d..b676e72 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -1807,6 +1807,45 @@ Attach a cache pool to an LV (infers --type cache).
.br
-
+Attach a cache to an LV, converts the LV to type cache.
+.br
+.P
+\fBlvconvert\fP \fB-H\fP|\fB--cache\fP \fB--cachevol\fP \fILV\fP \fILV\fP\fI_linear_striped_thinpool_raid\fP
+.br
+.RS 4
+.ad l
+[ \fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP ]
+.ad b
+.br
+.ad l
+[ \fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT] ]
+.ad b
+.br
+.ad l
+[ \fB--cachemetadataformat\fP \fBauto\fP|\fB1\fP|\fB2\fP ]
+.ad b
+.br
+.ad l
+[ \fB--cachemode\fP \fBwritethrough\fP|\fBwriteback\fP|\fBpassthrough\fP ]
+.ad b
+.br
+.ad l
+[ \fB--cachepolicy\fP \fIString\fP ]
+.ad b
+.br
+.ad l
+[ \fB--cachesettings\fP \fIString\fP ]
+.ad b
+.br
+.ad l
+[ \fB--poolmetadatasize\fP \fISize\fP[m|UNIT] ]
+.ad b
+.br
+[ COMMON_OPTIONS ]
+.RE
+.br
+-
+
Convert LV to type vdopool.
.br
.P
diff --git a/man/pvscan.8_pregen b/man/pvscan.8_pregen
index ed5ba92..94c4268 100644
--- a/man/pvscan.8_pregen
+++ b/man/pvscan.8_pregen
@@ -115,6 +115,10 @@ Autoactivate a VG when all PVs are online.
[ \fB--minor\fP \fINumber\fP ]
.ad b
.br
+.ad l
+[ \fB--noudevsync\fP ]
+.ad b
+.br
[ COMMON_OPTIONS ]
.RE
.br
@@ -289,6 +293,15 @@ Disable locking.
.ad b
.HP
.ad l
+\fB--noudevsync\fP
+.br
+Disables udev synchronisation. The process will not wait for notification
+from udev. It will continue irrespective of any possible udev processing
+in the background. Only use this if udev is not running or has rules that
+ignore the devices LVM creates.
+.ad b
+.HP
+.ad l
\fB-n\fP|\fB--novolumegroup\fP
.br
Only show PVs not belonging to any VG.