Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=664a9f4830925cc3…
Commit: 664a9f4830925cc3f51934dc09f9e2f3963c0de2
Parent: 3ea396e9d220cec55fd4e139be7ae486cb4ddb91
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jul 15 16:08:02 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Aug 12 14:11:15 2015 +0200
configure: --clear-need-check-flag needs 0.5.4
Require version 5.4 of cache_check tool where this option
will work correctly.
---
WHATS_NEW | 1 +
configure | 25 ++++++++++++++++---------
configure.in | 25 ++++++++++++++++---------
3 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8241dc1..d28e06c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.128 -
===================================
+ Require cache_check 0.5.4 for use of --clear-needs-check-flag.
Fix lvmetad udev rules to not override SYSTEMD_WANTS, add the service instead.
Version 2.02.127 - 10th August 2015
diff --git a/configure b/configure
index 07059b8..b17e5a3 100755
--- a/configure
+++ b/configure
@@ -8813,20 +8813,27 @@ $as_echo "$as_me: WARNING: cache_check not found in path $PATH" >&2;}
fi
fi
if test "$CACHE_CHECK_NEEDS_CHECK" = yes; then
- CACHE_CHECK_VSN=`"$CACHE_CHECK_CMD" -V 2>/dev/null`
- CACHE_CHECK_VSN_MAJOR=`echo "$CACHE_CHECK_VSN" | $AWK -F '.' '{print $1}'`
- CACHE_CHECK_VSN_MINOR=`echo "$CACHE_CHECK_VSN" | $AWK -F '.' '{print $2}'`
-
- if test -z "$CACHE_CHECK_VSN_MAJOR" -o -z "$CACHE_CHECK_VSN_MINOR"; then
+ $CACHE_CHECK_CMD -V 2>/dev/null >conftest.tmp
+ read -r CACHE_CHECK_VSN < conftest.tmp
+ IFS=. read -r CACHE_CHECK_VSN_MAJOR CACHE_CHECK_VSN_MINOR CACHE_CHECK_VSN_PATCH < conftest.tmp
+ rm -f conftest.tmp
+
+ # Require version >= 0.5.4 for --clear-needs-check-flag
+ if test -z "$CACHE_CHECK_VSN_MAJOR" \
+ || test -z "$CACHE_CHECK_VSN_MINOR" \
+ || test -z "$CACHE_CHECK_VSN_PATCH"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CACHE_CHECK_CMD: Bad version \"$CACHE_CHECK_VSN\" found" >&5
$as_echo "$as_me: WARNING: $CACHE_CHECK_CMD: Bad version \"$CACHE_CHECK_VSN\" found" >&2;}
CACHE_CHECK_VERSION_WARN=y
CACHE_CHECK_NEEDS_CHECK=no
- elif test "$CACHE_CHECK_VSN_MAJOR" -eq 0 -a "$CACHE_CHECK_VSN_MINOR" -lt 5; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CACHE_CHECK_CMD: Old version \"$CACHE_CHECK_VSN\" found" >&5
+ elif test "$CACHE_CHECK_VSN_MAJOR" -eq 0 ; then
+ if test "$CACHE_CHECK_VSN_MINOR" -lt 5 \
+ || test "$CACHE_CHECK_VSN_MINOR" -eq 5 -a "$CACHE_CHECK_VSN_PATCH" -lt 4; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CACHE_CHECK_CMD: Old version \"$CACHE_CHECK_VSN\" found" >&5
$as_echo "$as_me: WARNING: $CACHE_CHECK_CMD: Old version \"$CACHE_CHECK_VSN\" found" >&2;}
- CACHE_CHECK_VERSION_WARN=y
- CACHE_CHECK_NEEDS_CHECK=no
+ CACHE_CHECK_VERSION_WARN=y
+ CACHE_CHECK_NEEDS_CHECK=no
+ fi
fi
fi
# Empty means a config way to ignore cache dumping
diff --git a/configure.in b/configure.in
index 1825fb7..243b634 100644
--- a/configure.in
+++ b/configure.in
@@ -584,18 +584,25 @@ case "$CACHE" in
fi
fi
if test "$CACHE_CHECK_NEEDS_CHECK" = yes; then
- CACHE_CHECK_VSN=`"$CACHE_CHECK_CMD" -V 2>/dev/null`
- CACHE_CHECK_VSN_MAJOR=`echo "$CACHE_CHECK_VSN" | $AWK -F '.' '{print $1}'`
- CACHE_CHECK_VSN_MINOR=`echo "$CACHE_CHECK_VSN" | $AWK -F '.' '{print $2}'`
-
- if test -z "$CACHE_CHECK_VSN_MAJOR" -o -z "$CACHE_CHECK_VSN_MINOR"; then
+ $CACHE_CHECK_CMD -V 2>/dev/null >conftest.tmp
+ read -r CACHE_CHECK_VSN < conftest.tmp
+ IFS=. read -r CACHE_CHECK_VSN_MAJOR CACHE_CHECK_VSN_MINOR CACHE_CHECK_VSN_PATCH < conftest.tmp
+ rm -f conftest.tmp
+
+ # Require version >= 0.5.4 for --clear-needs-check-flag
+ if test -z "$CACHE_CHECK_VSN_MAJOR" \
+ || test -z "$CACHE_CHECK_VSN_MINOR" \
+ || test -z "$CACHE_CHECK_VSN_PATCH"; then
AC_MSG_WARN([$CACHE_CHECK_CMD: Bad version "$CACHE_CHECK_VSN" found])
CACHE_CHECK_VERSION_WARN=y
CACHE_CHECK_NEEDS_CHECK=no
- elif test "$CACHE_CHECK_VSN_MAJOR" -eq 0 -a "$CACHE_CHECK_VSN_MINOR" -lt 5; then
- AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" found])
- CACHE_CHECK_VERSION_WARN=y
- CACHE_CHECK_NEEDS_CHECK=no
+ elif test "$CACHE_CHECK_VSN_MAJOR" -eq 0 ; then
+ if test "$CACHE_CHECK_VSN_MINOR" -lt 5 \
+ || test "$CACHE_CHECK_VSN_MINOR" -eq 5 -a "$CACHE_CHECK_VSN_PATCH" -lt 4; then
+ AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" found])
+ CACHE_CHECK_VERSION_WARN=y
+ CACHE_CHECK_NEEDS_CHECK=no
+ fi
fi
fi
# Empty means a config way to ignore cache dumping
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=819dc1845edcf48e…
Commit: 819dc1845edcf48e0f3eb282a6d8b9ace8cb1a1b
Parent: 53c08f0bba9f18df80403eab67acb032f3049902
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Aug 11 12:12:22 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Aug 11 12:17:24 2015 -0500
lvconvert: fix lockd LV locking
Request a transient LV lock from lvmlockd when
converting an LV. If the LV is inactive when
lvconvert is run, the LV lock will be acquired
and then released when the command is done.
If the LV is active, a persistent lock exists
already and the transient lock request does nothing.
This fixes the issue that had been mentioned in the
comment previously.
---
tools/lvconvert.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 6a0e0ca..3a7f9ae 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3427,14 +3427,12 @@ static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp
}
/*
- * If the lv is inactive before and after the command, the
- * use of PERSISTENT here means the lv will remain locked as
- * an effect of running the lvconvert.
- * To unlock it, it would need to be activated+deactivated.
- * Or, we could identify the commands for which the lv remains
- * inactive, and not use PERSISTENT here for those cases.
+ * Request a transient lock. If the LV is active, it has a persistent
+ * lock already, and this request does nothing. If the LV is not
+ * active, this acquires a transient lock that will be released when
+ * the command exits.
*/
- if (!lockd_lv(cmd, lv, "ex", LDLV_PERSISTENT))
+ if (!lockd_lv(cmd, lv, "ex", 0))
goto_bad;
/*
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=53c08f0bba9f18df…
Commit: 53c08f0bba9f18df80403eab67acb032f3049902
Parent: 597de9d58673f141bf21aa9db899d13ca2c97b7b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Aug 10 15:46:21 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Aug 10 15:46:21 2015 -0500
lvrename: fix lockd LV locking
lvrename should not be done if the LV is active on another host.
This check was mistakenly removed when the code was changed to
use LV uuids in locks rather than LV names.
---
lib/metadata/lv_manip.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 86411d5..b22773e 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4205,6 +4205,18 @@ int lv_rename_update(struct cmd_context *cmd, struct logical_volume *lv,
return 0;
}
+ /*
+ * The lvmlockd LV lock is only acquired here to ensure the LV is not
+ * active on another host. This requests a transient LV lock.
+ * If the LV is active, a persistent LV lock already exists in
+ * lvmlockd, and the transient lock request does nothing.
+ * If the LV is not active, then no LV lock exists and the transient
+ * lock request acquires the LV lock (or fails). The transient lock
+ * is automatically released when the command exits.
+ */
+ if (!lockd_lv(cmd, lv, "ex", 0))
+ return_0;
+
if (update_mda && !archive(vg))
return_0;