master - vgsplit: Make vgsplit work on mirrors with leg and log on same PV
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9ac858fe6b5631...
Commit: 9ac858fe6b56318cee821e86e4a5edede75d5134
Parent: 0ee9d59b48b7b5eb844f6857977641e7a95f7ccb
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Fri Apr 25 14:53:34 2014 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Fri Apr 25 14:53:34 2014 -0500
vgsplit: Make vgsplit work on mirrors with leg and log on same PV
Given a named mirror LV, vgsplit will look for the PVs that compose it
and move them to a new VG. It does this by first looking at the log
and then the legs. If the log is on the same device as one of the mirror
images, a problem occurs. This is because the PV is moved to the new VG
as the log is processed and thus cannot be found in the current VG when
the image is processed. The solution is to check and see if the PV we are
looking for has already been moved to the new VG. If so, it is not an
error.
---
lib/metadata/metadata.c | 23 +++++++++++++---
test/shell/vgsplit-operation.sh | 55 +++++++++++++++++++++++++++++++++++++-
2 files changed, 72 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 6bc7e3a..edc55ef 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -360,14 +360,23 @@ out:
return r;
}
-int move_pv(struct volume_group *vg_from, struct volume_group *vg_to,
- const char *pv_name)
+int _move_pv(struct volume_group *vg_from, struct volume_group *vg_to,
+ const char *pv_name, int enforce_pv_from_source)
{
struct physical_volume *pv;
struct pv_list *pvl;
/* FIXME: handle tags */
if (!(pvl = find_pv_in_vg(vg_from, pv_name))) {
+ if (!enforce_pv_from_source &&
+ (pvl = find_pv_in_vg(vg_to, pv_name)))
+ /*
+ * PV has already been moved. This can happen if an
+ * LV is being moved that has multiple sub-LVs on the
+ * same PV.
+ */
+ return 1;
+
log_error("Physical volume %s not in volume group %s",
pv_name, vg_from->name);
return 0;
@@ -391,6 +400,12 @@ int move_pv(struct volume_group *vg_from, struct volume_group *vg_to,
return 1;
}
+int move_pv(struct volume_group *vg_from, struct volume_group *vg_to,
+ const char *pv_name)
+{
+ return _move_pv(vg_from, vg_to, pv_name, 1);
+}
+
int move_pvs_used_by_lv(struct volume_group *vg_from,
struct volume_group *vg_to,
const char *lv_name)
@@ -418,8 +433,8 @@ int move_pvs_used_by_lv(struct volume_group *vg_from,
return_0;
for (s = 0; s < lvseg->area_count; s++) {
if (seg_type(lvseg, s) == AREA_PV) {
- if (!move_pv(vg_from, vg_to,
- pv_dev_name(seg_pv(lvseg, s))))
+ if (!_move_pv(vg_from, vg_to,
+ pv_dev_name(seg_pv(lvseg, s)), 0))
return_0;
} else if (seg_type(lvseg, s) == AREA_LV) {
lv = seg_lv(lvseg, s);
diff --git a/test/shell/vgsplit-operation.sh b/test/shell/vgsplit-operation.sh
index 4c9e6f1..097f0f5 100644
--- a/test/shell/vgsplit-operation.sh
+++ b/test/shell/vgsplit-operation.sh
@@ -79,6 +79,10 @@ COMM "vgsplit correctly splits mirror LV into $i VG ($j args)"
lvcreate -an -Zn -l 64 --type mirror -m1 -n $lv1 $vg1 "$dev1" "$dev2" "$dev3"
if [ $j = PV ]; then
+ # FIXME: Not an exhaustive check of possible bad combinations
+ not vgsplit $vg1 $vg2 "$dev1" "$dev2"
+ not vgsplit $vg1 $vg2 "$dev1" "$dev3"
+ not vgsplit $vg1 $vg2 "$dev2" "$dev3"
vgsplit $vg1 $vg2 "$dev1" "$dev2" "$dev3"
else
vgsplit -n $lv1 $vg1 $vg2
@@ -90,7 +94,27 @@ COMM "vgsplit correctly splits mirror LV into $i VG ($j args)"
fi
lvremove -f $vg2/$lv1
vgremove -f $vg2
-# FIXME: ensure split /doesn't/ work when not all devs of mirror specified
+
+# RHBZ 875903
+COMM "vgsplit correctly splits mirror (log+leg on same dev) into $i VG ($j args)"
+ create_vg_ $vg1 "$dev1" "$dev2" "$dev3"
+ test $i = existing && create_vg_ $vg2 "$dev4"
+
+ lvcreate -an -Zn -l 64 --type mirror -m1 -n $lv1 $vg1 "$dev1" "$dev2"
+ if [ $j = PV ]; then
+ not vgsplit $vg1 $vg2 "$dev1"
+ not vgsplit $vg1 $vg2 "$dev2"
+ vgsplit $vg1 $vg2 "$dev1" "$dev2"
+ else
+ vgsplit -n $lv1 $vg1 $vg2
+ fi
+ if [ $i = existing ]; then
+ check pvlv_counts $vg2 3 1 0
+ else
+ check pvlv_counts $vg2 2 1 0
+ fi
+ lvremove -f $vg2/$lv1
+ vgremove -f $vg1 $vg2
COMM "vgsplit correctly splits mirror LV with mirrored log into $i VG ($j args)"
create_vg_ -c n $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
@@ -100,6 +124,11 @@ COMM "vgsplit correctly splits mirror LV with mirrored log into $i VG ($j args)"
"$dev1" "$dev2" "$dev3" "$dev4"
if [ $j = PV ]; then
+ # FIXME: Not an exhaustive check of possible bad combinations
+ not vgsplit $vg1 $vg2 "$dev1" "$dev2"
+ not vgsplit $vg1 $vg2 "$dev3" "$dev4"
+ not vgsplit $vg1 $vg2 "$dev1" "$dev3"
+ not vgsplit $vg1 $vg2 "$dev2" "$dev4"
vgsplit $vg1 $vg2 "$dev1" "$dev2" "$dev3" "$dev4"
else
vgsplit -n $lv1 $vg1 $vg2
@@ -111,7 +140,29 @@ COMM "vgsplit correctly splits mirror LV with mirrored log into $i VG ($j args)"
fi
lvremove -f $vg2/$lv1
vgremove -f $vg2
-# FIXME: ensure split /doesn't/ work when not all devs of mirror specified
+
+# RHBZ 875903
+COMM "vgsplit correctly splits mirror LV with mirrored log on same devs into $i VG ($j args)"
+ create_vg_ -c n $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
+ test $i = existing && create_vg_ -c n $vg2 "$dev5"
+
+ lvcreate -an -Zn -l 64 --mirrorlog mirrored --type mirror -m1 -n $lv1 $vg1 \
+ "$dev1" "$dev2"
+
+ if [ $j = PV ]; then
+ not vgsplit $vg1 $vg2 "$dev1"
+ not vgsplit $vg1 $vg2 "$dev2"
+ vgsplit $vg1 $vg2 "$dev1" "$dev2"
+ else
+ vgsplit -n $lv1 $vg1 $vg2
+ fi
+ if [ $i = existing ]; then
+ check pvlv_counts $vg2 3 1 0
+ else
+ check pvlv_counts $vg2 2 1 0
+ fi
+ lvremove -f $vg2/$lv1
+ vgremove -f $vg1 $vg2
COMM "vgsplit correctly splits origin and snapshot LV into $i VG ($j args)"
create_vg_ $vg1 "$dev1" "$dev2"
10 years
master - test: configurable write timeout
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0ee9d59b48b7b5...
Commit: 0ee9d59b48b7b5eb844f6857977641e7a95f7ccb
Parent: 448af9ff0ba04bfaeb45c15819f577fef089fd95
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Apr 24 22:44:22 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Apr 24 22:44:22 2014 +0100
test: configurable write timeout
Hard-coded 3 minutes is far too short when investigating problems.
---
test/lib/harness.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/test/lib/harness.c b/test/lib/harness.c
index 7ee45c8..d7e51ee 100644
--- a/test/lib/harness.c
+++ b/test/lib/harness.c
@@ -36,6 +36,7 @@ static int fds[2];
#define MAX 1024
#define MAX_LOG_SIZE (32*1024*1024) /* Default max size of test log */
+#define WRITE_TIMEOUT (180 * 2) /* 3 minutes */
struct stats {
int nfailed;
@@ -59,6 +60,7 @@ static int quiet = 0;
static const char *results;
static unsigned fullbuffer = 0;
static int unlimited = 0;
+static int write_timeout = WRITE_TIMEOUT;
static time_t harness_start;
@@ -433,13 +435,13 @@ static void run(int i, char *f) {
struct timeval selectwait = { .tv_usec = 500000 }; /* 0.5s */
if ((fullbuffer && fullbuffer++ == 8000) ||
- (no_write > 180 * 2)) /* a 3 minute timeout */
+ (write_timeout > 0 && no_write > write_timeout))
{
timeout:
kill(pid, SIGINT);
sleep(5); /* wait a bit for a reaction */
if ((w = waitpid(pid, &st, WNOHANG)) == 0) {
- if (no_write > 180 * 2)
+ if (write_timeout > 0 && no_write > write_timeout)
/*
* Kernel traces needed, when stuck for
* too long in userspace without producing
@@ -533,7 +535,8 @@ int main(int argc, char **argv) {
const char *result;
const char *be_verbose = getenv("VERBOSE"),
*be_interactive = getenv("INTERACTIVE"),
- *be_quiet = getenv("QUIET");;
+ *be_quiet = getenv("QUIET"),
+ *be_write_timeout = getenv("WRITE_TIMEOUT");
time_t start = time(NULL);
int i;
FILE *list;
@@ -552,6 +555,9 @@ int main(int argc, char **argv) {
if (be_quiet)
quiet = atoi(be_quiet);
+ if (be_write_timeout)
+ write_timeout = atoi(be_write_timeout) * 2;
+
results = getenv("LVM_TEST_RESULTS") ? : "results";
unlimited = getenv("LVM_TEST_UNLIMITED") ? 1 : 0;
(void) snprintf(results_list, sizeof(results_list), "%s/list", results);
10 years
master - NIX: Fix failure mode for "make check".
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=448af9ff0ba04b...
Commit: 448af9ff0ba04bfaeb45c15819f577fef089fd95
Parent: 9676ee9ba9414c64bf9b519479f69be99e9a1dc7
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Thu Apr 24 21:03:58 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Apr 24 21:35:31 2014 +0200
NIX: Fix failure mode for "make check".
---
nix/default.nix | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index 81e9d30..faf179a 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -204,6 +204,7 @@ let
echo "%define check_commands \\";
echo "make lcov-reset \\";
echo "dmsetup targets\\";
+ echo "mkdir -p \$out/nix-support \\";
echo "make check QUIET=1 T=${T} || touch \$out/nix-support/failed \\"
echo "pwd > /tmp/build-location \\"
echo "touch rpm-no-clean") >> source.inc
10 years
master - test: Fix default.profile path.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9676ee9ba9414c...
Commit: 9676ee9ba9414c64bf9b519479f69be99e9a1dc7
Parent: 22037ee3289d3929b534812905b5c6d30f9ee4f8
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Apr 24 18:52:29 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Apr 24 18:52:29 2014 +0100
test: Fix default.profile path.
It's a generated file.
---
test/Makefile.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 7253bb4..33d8ab4 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -177,7 +177,7 @@ CMDS = lvm $(shell cat $(top_builddir)/tools/.commands)
ln -fs $(abs_top_builddir)/daemons/lvmetad/lvmetad lib/lvmetad
ln -fs $(abs_top_srcdir)/scripts/vgimportclone.sh lib/vgimportclone
ln -fs $(abs_top_srcdir)/scripts/fsadm.sh lib/fsadm
- ln -fs $(abs_top_srcdir)/conf/default.profile lib/default.profile
+ ln -fs $(abs_top_builddir)/conf/default.profile lib/default.profile
ln -fs $(abs_top_srcdir)/conf/thin-performance.profile lib/thin-performance.profile
touch $@
10 years
master - tests: fix creation of scsi debug
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=22037ee3289d39...
Commit: 22037ee3289d3929b534812905b5c6d30f9ee4f8
Parent: 8e8a47143fa920b49f279ec4d096022a1afb36ec
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 24 14:40:15 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 24 14:42:27 2014 +0200
tests: fix creation of scsi debug
Use proper '||' test form to avoid unwanted test abort
on failure.
(i.e. running failing test profiles-thin.sh on a real /dev)
---
test/lib/aux.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 76cfd82..8b765e9 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -302,7 +302,7 @@ prepare_scsi_debug_dev() {
local DEV_SIZE=$1
local SCSI_DEBUG_PARAMS=${@:2}
- test -f "SCSI_DEBUG_DEV" && return 0
+ test ! -f "SCSI_DEBUG_DEV" || return 0
test -z "$LOOP"
test -n "$DM_DEV_DIR"
@@ -311,7 +311,7 @@ prepare_scsi_debug_dev() {
# Skip test if scsi_debug module is unavailable or is already in use
modprobe --dry-run scsi_debug || skip
- lsmod | grep -q scsi_debug && skip
+ lsmod | not grep -q scsi_debug || skip
# Create the scsi_debug device and determine the new scsi device's name
# NOTE: it will _never_ make sense to pass num_tgts param;
@@ -327,7 +327,7 @@ prepare_scsi_debug_dev() {
echo "$SCSI_DEBUG_DEV" > SCSI_DEBUG_DEV
echo "$SCSI_DEBUG_DEV" > LOOP
# Setting $LOOP provides means for prepare_devs() override
- test "$LVM_TEST_DEVDIR" != "/dev" && ln -snf "$DEBUG_DEV" "$SCSI_DEBUG_DEV"
+ test "$LVM_TEST_DEVDIR" = "/dev" || ln -snf "$DEBUG_DEV" "$SCSI_DEBUG_DEV"
}
cleanup_scsi_debug_dev() {
10 years
master - config: use devices/ignore_suspended_devices=0 by default
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8e8a47143fa920...
Commit: 8e8a47143fa920b49f279ec4d096022a1afb36ec
Parent: 2b09def6068e69a920972211572235a827e7c474
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Apr 24 12:12:28 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Apr 24 12:12:39 2014 +0200
config: use devices/ignore_suspended_devices=0 by default
ignore_suspended_devices=0 is already used in lvm.conf we distribute,
but it was still "1" in the code (so it was used when lvm.conf value
was not defined). It should be "0" too.
---
WHATS_NEW | 1 +
lib/config/defaults.h | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index e7c9b04..1615f37 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Use devices/ignore_suspended_devices=0 by default if not defined in lvm.conf.
Use proper libmem mempool for allocation of unknown segment name.
Add --readonly to reporting and display tools for lock-free metadata access.
Add locking_type 5 for dummy locking for tools that do not need any locks.
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 2268e0b..137b4c8 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -35,7 +35,7 @@
#define DEFAULT_MD_CHUNK_ALIGNMENT 1
#define DEFAULT_IGNORE_LVM_MIRRORS 1
#define DEFAULT_MULTIPATH_COMPONENT_DETECTION 1
-#define DEFAULT_IGNORE_SUSPENDED_DEVICES 1
+#define DEFAULT_IGNORE_SUSPENDED_DEVICES 0
#define DEFAULT_DISABLE_AFTER_ERROR_COUNT 0
#define DEFAULT_REQUIRE_RESTOREFILE_WITH_UUID 1
#define DEFAULT_DATA_ALIGNMENT_OFFSET_DETECTION 1
10 years
master - man: minor fixes in lvmetad man page
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2b09def6068e69...
Commit: 2b09def6068e69a920972211572235a827e7c474
Parent: 795944f178c233ac3f638574de704322f130078a
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Apr 23 14:31:42 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Apr 23 14:34:42 2014 +0200
man: minor fixes in lvmetad man page
- better add reference to lvm dumpconfig --type default
than stating that lvmetad is not enabled by default
- substitute #DEFAULT_PID_DIR# with concrete value
---
aclocal.m4 | 15 +++++++++++++++
configure | 2 ++
configure.in | 1 +
man/Makefile.in | 2 +-
man/lvmetad.8.in | 5 ++++-
5 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index c9f8f52..6f752f2 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -212,4 +212,19 @@ m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_NOARCH_INSTALLDIR
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
+
m4_include([acinclude.m4])
diff --git a/configure b/configure
index 2032e15..bc8abd9 100755
--- a/configure
+++ b/configure
@@ -697,6 +697,7 @@ DMEVENTD
DL_LIBS
DEVMAPPER
DEFAULT_RUN_DIR
+DEFAULT_PID_DIR
DEFAULT_DM_RUN_DIR
DEFAULT_LOCK_DIR
DEFAULT_DATA_ALIGNMENT
@@ -11539,6 +11540,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile conf/Makefile conf/example.conf conf/default.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.s
h scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/lvm2_clvmd_systemd_red_hat.service scripts/cmirrord_init_red_hat scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.socket scripts/dm_event_systemd_red_hat.service scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
diff --git a/configure.in b/configure.in
index f3c3570..3a6dc15 100644
--- a/configure.in
+++ b/configure.in
@@ -1674,6 +1674,7 @@ AC_SUBST(DEFAULT_PROFILE_SUBDIR)
AC_SUBST(DEFAULT_DATA_ALIGNMENT)
AC_SUBST(DEFAULT_LOCK_DIR)
AC_SUBST(DEFAULT_DM_RUN_DIR)
+AC_SUBST(DEFAULT_PID_DIR)
AC_SUBST(DEFAULT_RUN_DIR)
AC_SUBST(DEVMAPPER)
AC_SUBST(DLM_CFLAGS)
diff --git a/man/Makefile.in b/man/Makefile.in
index 6c59c8e..af108cf 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -96,7 +96,7 @@ $(MAN5) $(MAN7) $(MAN8) $(MAN8DM) $(MAN8CLUSTER): Makefile
%: %.in
@case "$@" in \
*/*) ;; \
- *) echo "Creating $@" ; $(SED) -e "s+#VERSION#+$(LVM_VERSION)+;s+#DEFAULT_SYS_DIR#+$(DEFAULT_SYS_DIR)+;s+#DEFAULT_ARCHIVE_DIR#+$(DEFAULT_ARCHIVE_DIR)+;s+#DEFAULT_BACKUP_DIR#+$(DEFAULT_BACKUP_DIR)+;s+#DEFAULT_PROFILE_DIR#+$(DEFAULT_PROFILE_DIR)+;s+#DEFAULT_CACHE_DIR#+$(DEFAULT_CACHE_DIR)+;s+#DEFAULT_LOCK_DIR#+$(DEFAULT_LOCK_DIR)+;s+#CLVMD_PATH#+@CLVMD_PATH@+;s+#LVM_PATH#+@LVM_PATH@+;s+#DEFAULT_RUN_DIR#+@DEFAULT_RUN_DIR@+;s+#SYSTEMD_GENERATOR_DIR#+$(SYSTEMD_GENERATOR_DIR)+;" $< > $@ ;; \
+ *) echo "Creating $@" ; $(SED) -e "s+#VERSION#+$(LVM_VERSION)+;s+#DEFAULT_SYS_DIR#+$(DEFAULT_SYS_DIR)+;s+#DEFAULT_ARCHIVE_DIR#+$(DEFAULT_ARCHIVE_DIR)+;s+#DEFAULT_BACKUP_DIR#+$(DEFAULT_BACKUP_DIR)+;s+#DEFAULT_PROFILE_DIR#+$(DEFAULT_PROFILE_DIR)+;s+#DEFAULT_CACHE_DIR#+$(DEFAULT_CACHE_DIR)+;s+#DEFAULT_LOCK_DIR#+$(DEFAULT_LOCK_DIR)+;s+#CLVMD_PATH#+@CLVMD_PATH@+;s+#LVM_PATH#+@LVM_PATH@+;s+#DEFAULT_RUN_DIR#+@DEFAULT_RUN_DIR@+;s+#DEFAULT_PID_DIR#+@DEFAULT_PID_DIR@+;s+#SYSTEMD_GENERATOR_DIR#+$(SYSTEMD_GENERATOR_DIR)+;" $< > $@ ;; \
esac
install_man5: $(MAN5)
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index 444c7c0..a8ca678 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -19,7 +19,10 @@ from udev rules (which must be installed for LVM to work correctly when lvmetad
is in use). Through these notifications, lvmetad has an up-to-date and
consistent image of the volume groups available in the system.
-By default, lvmetad, even if running, is not used by LVM. See \fBlvm.conf\fP(5).
+lvmetad is used by LVM only if it is enabled in \fBlvm.conf\fP(5) by specifying the
+\fBglobal/use_lvmetad\fP setting. If this is not defined in the LVM configuration
+explicitly then default setting is used instead (see the output of
+\fBlvm dumpconfig --type default global/use_lvmetad\fP command).
.SH OPTIONS
To run the daemon in a test environment both the pidfile_path and the
10 years
master - test: add lvresize tests
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=795944f178c233...
Commit: 795944f178c233ac3f638574de704322f130078a
Parent: 7a1777302ff21bbc7cd81a1141f9c88c8fac2511
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Apr 22 12:47:14 2014 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Apr 22 12:53:30 2014 +0200
test: add lvresize tests
- test for Bug 1088153
- test lvextend does not reduce nor lvreduce extend LV
---
test/shell/lvresize-usage.sh | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvresize-usage.sh b/test/shell/lvresize-usage.sh
index 84431ed..65f6b1e 100644
--- a/test/shell/lvresize-usage.sh
+++ b/test/shell/lvresize-usage.sh
@@ -24,3 +24,14 @@ not lvresize -v -l +4 xxx/$lv
ESIZE=$(get vg_field $vg vg_extent_size --units b)
lvextend -L+64m -i 2 -I$(( ${ESIZE%%B} * 2 ))B $vg/$lv 2>&1 | tee err
grep "Reducing stripe size" err
+
+lvremove -ff $vg
+
+lvcreate -L 10M -n lv $vg $dev1
+lvextend -L +10M $vg/lv $dev2
+
+# Attempt to reduce with lvextend and vice versa:
+not lvextend -L 16M $vg/lv
+not lvreduce -L 32M $vg/lv
+
+lvremove -ff $vg
10 years
master - cleanup: dmeventd simplify restart message parsing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7a1777302ff21b...
Commit: 7a1777302ff21bbc7cd81a1141f9c88c8fac2511
Parent: 1f701c7bf6dfd9893f7ebf18cb572de4fd3fcdde
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 18 15:17:57 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 18 16:53:29 2014 +0200
cleanup: dmeventd simplify restart message parsing
Since we already check every characted in the message,
skip extra callback to strlen, and do the implicit
message length checking.
---
daemons/dmeventd/dmeventd.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 7decbcb..dcde7b1 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -1918,7 +1918,6 @@ static void restart(void)
struct dm_event_daemon_message msg = { 0 };
int i, count = 0;
char *message;
- int length;
int version;
const char *e;
@@ -1943,16 +1942,12 @@ static void restart(void)
if (daemon_talk(&fifos, &msg, DM_EVENT_CMD_GET_STATUS, "-", "-", 0, 0))
goto bad;
- message = msg.data;
- message = strchr(message, ' ');
- ++ message;
- length = strlen(msg.data);
- for (i = 0; i < length; ++i) {
+ message = strchr(msg.data, ' ') + 1;
+ for (i = 0; msg.data[i]; ++i)
if (msg.data[i] == ';') {
msg.data[i] = 0;
++count;
}
- }
if (!(_initial_registrations = dm_malloc(sizeof(char*) * (count + 1)))) {
fprintf(stderr, "Memory allocation registration failed.\n");
10 years
master - cleanup: dmeventd drop setting of size
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1f701c7bf6dfd9...
Commit: 1f701c7bf6dfd9893f7ebf18cb572de4fd3fcdde
Parent: 78c6dea48efff2a45e47f29aa171f18b5b8c46b0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 18 15:12:59 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 18 16:52:59 2014 +0200
cleanup: dmeventd drop setting of size
Size is not used when msg->data is NULL.
---
daemons/dmeventd/dmeventd.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 85f1b34..7decbcb 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -382,7 +382,6 @@ static int _parse_message(struct message_data *message_data)
dm_free(msg->data);
msg->data = NULL;
- msg->size = 0;
return ret;
}
@@ -1128,10 +1127,8 @@ static int _registered_device(struct message_data *message_data,
if ((r = dm_asprintf(&(msg->data), "%s %s %s %u",
message_data->id,
thread->dso_data->dso_name,
- thread->device.uuid, events)) < 0) {
- msg->size = 0;
+ thread->device.uuid, events)) < 0)
return -ENOMEM;
- }
msg->size = (uint32_t) r;
@@ -1242,10 +1239,9 @@ static int _get_timeout(struct message_data *message_data)
if ((thread = _lookup_thread_status(message_data))) {
msg->size = dm_asprintf(&(msg->data), "%s %" PRIu32,
message_data->id, thread->timeout);
- } else {
+ } else
msg->data = NULL;
- msg->size = 0;
- }
+
_unlock_mutex();
return thread ? 0 : -ENODEV;
@@ -1384,7 +1380,6 @@ static int _client_read(struct dm_event_fifos *fifos,
if (bytes != size) {
dm_free(msg->data);
msg->data = NULL;
- msg->size = 0;
return 0;
}
@@ -1491,11 +1486,10 @@ static int _do_process_request(struct dm_event_daemon_message *msg)
answer = msg->data;
if (answer) {
msg->size = dm_asprintf(&(msg->data), "%s %s %d", answer,
- msg->cmd == DM_EVENT_CMD_DIE ? "DYING" : "HELLO",
+ (msg->cmd == DM_EVENT_CMD_DIE) ? "DYING" : "HELLO",
DM_EVENT_PROTOCOL_VERSION);
dm_free(answer);
- } else
- msg->size = 0;
+ }
} else if (msg->cmd != DM_EVENT_CMD_ACTIVE && !_parse_message(&message_data)) {
stack;
ret = -EINVAL;
10 years