master - lockd: allow vgexport and vgimport
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3da88b89172b58...
Commit: 3da88b89172b588bef69d62e18ed5db127b2c845
Parent: 9cfa27f9c56edad26c2830562233b48e06bb4802
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jul 13 13:48:39 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jul 13 14:07:57 2015 -0500
lockd: allow vgexport and vgimport
The "exported" state of the VG can be useful with lockd VGs
because the exported state keeps a VG from being used in general.
It's a way to keep a VG protected and out of the way.
Also fix the command flags: ALL_VGS_IS_DEFAULT is not true for
vgimport/vgexport, since they both return errors immediately if
no VG args are specified. LOCKD_VG_SH is not true for vgexport
beause it must use an ex lock to write the VG.
---
tools/commands.h | 4 ++--
tools/vgchange.c | 12 +++++++++---
tools/vgexport.c | 25 ++++++++++++++++++-------
tools/vgimport.c | 4 +++-
4 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/tools/commands.h b/tools/commands.h
index 43d5c80..e50505d 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -1191,7 +1191,7 @@ xx(vgdisplay,
xx(vgexport,
"Unregister volume group(s) from the system",
- ALL_VGS_IS_DEFAULT | LOCKD_VG_SH,
+ 0,
"vgexport\n"
"\t[-a|--all]\n"
"\t[--commandprofile ProfileName]\n"
@@ -1229,7 +1229,7 @@ xx(vgextend,
xx(vgimport,
"Register exported volume group with system",
- ALL_VGS_IS_DEFAULT,
+ 0,
"vgimport\n"
"\t[-a|--all]\n"
"\t[--commandprofile ProfileName]\n"
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 95cffaf..0ed8fec 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -888,7 +888,8 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
{ systemid_ARG, &_vgchange_system_id },
};
- if (vg_is_exported(vg)) {
+ if (vg_is_exported(vg) &&
+ !(arg_is_set(cmd, lockstop_ARG) || arg_is_set(cmd, lockstart_ARG))) {
log_error("Volume group \"%s\" is exported", vg_name);
return ECMD_FAILED;
}
@@ -1052,6 +1053,7 @@ static int _lockd_vgchange(struct cmd_context *cmd, int argc, char **argv)
int vgchange(struct cmd_context *cmd, int argc, char **argv)
{
+ uint32_t flags = 0;
int ret;
int noupdate =
@@ -1185,8 +1187,12 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
if (!_lockd_vgchange(cmd, argc, argv))
return_ECMD_FAILED;
- ret = process_each_vg(cmd, argc, argv, update ? READ_FOR_UPDATE : 0,
- NULL, &vgchange_single);
+ if (update)
+ flags |= READ_FOR_UPDATE;
+ if (arg_is_set(cmd, lockstart_ARG) || arg_is_set(cmd, lockstop_ARG))
+ flags |= READ_ALLOW_EXPORTED;
+
+ ret = process_each_vg(cmd, argc, argv, flags, NULL, &vgchange_single);
/* Wait for lock-start ops that were initiated in vgchange_lockstart. */
diff --git a/tools/vgexport.c b/tools/vgexport.c
index 7e90e5c..566cc96 100644
--- a/tools/vgexport.c
+++ b/tools/vgexport.c
@@ -22,19 +22,30 @@ static int vgexport_single(struct cmd_context *cmd __attribute__((unused)),
{
struct pv_list *pvl;
- /* vgexport/vgimport have to use with shared VGs. */
- if (is_lockd_type(vg->lock_type)) {
- log_error("Volume group \"%s\" has lock_type %s that cannot be exported",
- vg_name, vg->lock_type);
- goto bad;
- }
-
if (lvs_in_vg_activated(vg)) {
log_error("Volume group \"%s\" has active logical volumes",
vg_name);
goto bad;
}
+ if (is_lockd_type(vg->lock_type)) {
+ struct lv_list *lvl;
+ dm_list_iterate_items(lvl, &vg->lvs) {
+ if (!lockd_lv_uses_lock(lvl->lv))
+ continue;
+
+ if (!lockd_lv(cmd, lvl->lv, "ex", 0)) {
+ log_error("LV %s/%s must be inactive on all hosts before vgexport.",
+ vg->name, display_lvname(lvl->lv));
+ goto bad;
+ }
+
+ if (!lockd_lv(cmd, lvl->lv, "un", 0))
+ goto bad;
+ }
+ }
+
+
if (!archive(vg))
goto_bad;
diff --git a/tools/vgimport.c b/tools/vgimport.c
index b64a7a3..04a59dc 100644
--- a/tools/vgimport.c
+++ b/tools/vgimport.c
@@ -37,7 +37,9 @@ static int vgimport_single(struct cmd_context *cmd,
goto_bad;
vg->status &= ~EXPORTED_VG;
- vg->system_id = cmd->system_id ? dm_pool_strdup(vg->vgmem, cmd->system_id) : NULL;
+
+ if (!is_lockd_type(vg->lock_type))
+ vg->system_id = cmd->system_id ? dm_pool_strdup(vg->vgmem, cmd->system_id) : NULL;
dm_list_iterate_items(pvl, &vg->pvs) {
pv = pvl->pv;
8 years, 9 months
master - lockd: allow nolocking and readonly options
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9cfa27f9c56eda...
Commit: 9cfa27f9c56edad26c2830562233b48e06bb4802
Parent: c39f3026a8280bb4c62c785138302cd1475facb6
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 10 17:20:22 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jul 13 13:15:51 2015 -0500
lockd: allow nolocking and readonly options
When --nolocking is used (by vgs, lvs, pvs):
. don't use lvmlockd at all (set use_lvmlockd to 0)
. allow lockd VGs to be read
When --readonly is used (by vgs, lvs, pvs, vgdisplay, lvdisplay,
pvdisplay, lvmdiskscan, lvscan, pvscan, vgcfgbackup):
. skip actual lvmlockd locking calls
. allow lockd VGs to be read
. check that only shared gl/vg locks are being requested
(even though the actually locking is being skipped)
. check that no LV locks are requested, because no LVs
should be activated or used in readonly mode
. disable using lvmetad so VGs are read from disk
It is important to note the limited commands that accept
the --nolocking and --readonly options, i.e. no commands
that change/write a VG or change/activate LVs accept these
options, only commands that read VGs.
---
lib/locking/lvmlockd.c | 26 ++++++++++++++++++++++++++
tools/lvmcmdline.c | 22 +++++++++++++++++++++-
2 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 99fc047..a0dff8a 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -1346,6 +1346,14 @@ int lockd_gl(struct cmd_context *cmd, const char *def_mode, uint32_t flags)
if (!_use_lvmlockd)
return 1;
+ /*
+ * Verify that when --readonly is used, no ex locks should be used.
+ */
+ if (cmd->metadata_read_only && def_mode && !strcmp(def_mode, "ex")) {
+ log_error("Exclusive locks are not allowed with readonly option.");
+ return 0;
+ }
+
if (cmd->lockd_gl_disable)
return 1;
@@ -1529,6 +1537,16 @@ int lockd_vg(struct cmd_context *cmd, const char *vg_name, const char *def_mode,
return 1;
/*
+ * Verify that when --readonly is used, no ex locks should be used.
+ */
+ if (cmd->metadata_read_only &&
+ ((def_mode && !strcmp(def_mode, "ex")) ||
+ (!def_mode && !cmd->lockd_vg_default_sh))) {
+ log_error("Exclusive locks are not allowed with readonly option.");
+ return 0;
+ }
+
+ /*
* Some special cases need to disable the vg lock.
*/
if (cmd->lockd_vg_disable)
@@ -1799,6 +1817,14 @@ int lockd_lv_name(struct cmd_context *cmd, struct volume_group *vg,
int refreshed = 0;
int result;
+ /*
+ * Verify that when --readonly is used, no LVs should be activated or used.
+ */
+ if (cmd->metadata_read_only) {
+ log_error("LV locks are not allowed with readonly option.");
+ return 0;
+ }
+
if (cmd->lockd_lv_disable)
return 1;
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index c4a78b0..6dbc189 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1435,6 +1435,14 @@ static int _init_lvmlockd(struct cmd_context *cmd)
const char *lvmlockd_socket;
int use_lvmlockd = find_config_tree_bool(cmd, global_use_lvmlockd_CFG, NULL);
+ if (use_lvmlockd && arg_count(cmd, nolocking_ARG)) {
+ /* --nolocking is only allowed with vgs/lvs/pvs commands */
+ cmd->lockd_gl_disable = 1;
+ cmd->lockd_vg_disable = 1;
+ cmd->lockd_lv_disable = 1;
+ return 1;
+ }
+
if (use_lvmlockd && locking_is_clustered()) {
log_error("ERROR: configuration setting use_lvmlockd cannot be used with clustered locking_type 3.");
return 0;
@@ -1567,7 +1575,19 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
}
if (arg_count(cmd, readonly_ARG)) {
- locking_type = 5;
+ if (find_config_tree_bool(cmd, global_use_lvmlockd_CFG, NULL)) {
+ /*
+ * FIXME: we could use locking_type 5 here if that didn't
+ * cause CLUSTERED to be set, which conflicts with using lvmlockd.
+ */
+ locking_type = 1;
+ cmd->lockd_gl_disable = 1;
+ cmd->lockd_vg_disable = 1;
+ cmd->lockd_lv_disable = 1;
+ } else {
+ locking_type = 5;
+ }
+
if (lvmetad_used()) {
lvmetad_set_active(cmd, 0);
log_verbose("Disabling use of lvmetad because read-only is set.");
8 years, 9 months
master - vgexport: do not allow lockd VG to be exported
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c39f3026a8280b...
Commit: c39f3026a8280bb4c62c785138302cd1475facb6
Parent: 222bb2b88d06a67cc25ed19332919fa339d7e831
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 10 13:49:51 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 10 15:53:21 2015 -0500
vgexport: do not allow lockd VG to be exported
vgexport and vgimport have no use for a shared VG.
---
tools/vgexport.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/vgexport.c b/tools/vgexport.c
index 6d5b4f6..7e90e5c 100644
--- a/tools/vgexport.c
+++ b/tools/vgexport.c
@@ -22,6 +22,13 @@ static int vgexport_single(struct cmd_context *cmd __attribute__((unused)),
{
struct pv_list *pvl;
+ /* vgexport/vgimport have to use with shared VGs. */
+ if (is_lockd_type(vg->lock_type)) {
+ log_error("Volume group \"%s\" has lock_type %s that cannot be exported",
+ vg_name, vg->lock_type);
+ goto bad;
+ }
+
if (lvs_in_vg_activated(vg)) {
log_error("Volume group \"%s\" has active logical volumes",
vg_name);
8 years, 9 months
master - lockd: note that external origins don't work in lockd VGs
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=222bb2b88d06a6...
Commit: 222bb2b88d06a67cc25ed19332919fa339d7e831
Parent: b8538f5dcd2e1c0880607a2bbd067d6aa60e689a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 10 13:27:02 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 10 15:53:21 2015 -0500
lockd: note that external origins don't work in lockd VGs
in a comment at the point where it fails, and in the
lvmlockd man page.
---
man/lvmlockd.8.in | 2 ++
tools/lvconvert.c | 10 ++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/man/lvmlockd.8.in b/man/lvmlockd.8.in
index c3b0ac0..659fead 100644
--- a/man/lvmlockd.8.in
+++ b/man/lvmlockd.8.in
@@ -686,6 +686,8 @@ Things that do not yet work in lockd VGs:
.br
- using lvcreate to create cache pools or cache LVs (use lvconvert)
.br
+- using external origins for thin LVs
+.br
- splitting mirrors and snapshots from LVs
.br
- vgsplit
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index c543a1e..1461f4a 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2533,6 +2533,16 @@ static int _lvconvert_thin(struct cmd_context *cmd,
}
if (is_lockd_type(lv->vg->lock_type)) {
+ /*
+ * FIXME: external origins don't work in lockd VGs.
+ * Prior to the lvconvert, there's a lock associated with
+ * the uuid of the external origin LV. After the convert,
+ * that uuid belongs to the new thin LV, and a new LV with
+ * a new uuid exists as the non-thin, readonly external LV.
+ * We'd need to remove the lock for the previous uuid
+ * (the new thin LV will have no lock), and create a new
+ * lock for the new LV uuid used by the external LV.
+ */
log_error("Can't use lock_type %s LV as external origin.",
lv->vg->lock_type);
return 0;
8 years, 9 months
master - vgchange: allow changing to lockd type when mirrors exist
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b8538f5dcd2e1c...
Commit: b8538f5dcd2e1c0880607a2bbd067d6aa60e689a
Parent: c4fdcb04be174dd3ec68eb0c3f17dd8a08314b59
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 10 11:48:50 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 10 15:53:21 2015 -0500
vgchange: allow changing to lockd type when mirrors exist
and update lvmlockd man page to reflect the fact that
mirror LVs work correctly in lockd VGs.
---
man/lvmlockd.8.in | 4 +---
tools/vgchange.c | 17 -----------------
2 files changed, 1 insertions(+), 20 deletions(-)
diff --git a/man/lvmlockd.8.in b/man/lvmlockd.8.in
index 4d9b3f5..c3b0ac0 100644
--- a/man/lvmlockd.8.in
+++ b/man/lvmlockd.8.in
@@ -682,13 +682,11 @@ it are not autoactivated.
Things that do not yet work in lockd VGs:
.br
-- old style mirror LVs (only raid1)
-.br
- creating a new thin pool and a new thin LV in a single command
.br
- using lvcreate to create cache pools or cache LVs (use lvconvert)
.br
-- splitting raid1 mirror LVs
+- splitting mirrors and snapshots from LVs
.br
- vgsplit
.br
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 4b90b56..95cffaf 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -604,23 +604,6 @@ static int _vgchange_locktype(struct cmd_context *cmd,
return 0;
}
- /*
- * Check if there are any LV types in the VG that cannot be handled
- * with the new lock type. Remove this once all LV types can be
- * handled.
- */
- if (is_lockd_type(lock_type)) {
- dm_list_iterate_items(lvl, &vg->lvs) {
- lv = lvl->lv;
-
- if (lv_is_mirror_type(lv)) {
- log_error("Changing to lock type %s is not allowed with mirror type LV %s/%s",
- lock_type, vg->name, display_lvname(lv));
- return 0;
- }
- }
- }
-
/* none to clvm */
if (!strcmp(vg->lock_type, "none") && !strcmp(lock_type, "clvm")) {
log_warn("New clvm lock type will not be usable with lvmlockd.");
8 years, 9 months
master - lvconvert: disallow splitting in lockd VGs
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c4fdcb04be174d...
Commit: c4fdcb04be174dd3ec68eb0c3f17dd8a08314b59
Parent: 0823511262bd52bb14b150a180fcd23ea35fc8fb
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 10 11:46:24 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 10 15:53:21 2015 -0500
lvconvert: disallow splitting in lockd VGs
A new lockd lock needs to be created for the new LV
created by split mirror and split snapshot. Disallow
these options in lockd VGs until that is implemented.
---
tools/lvconvert.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index b10798e..c543a1e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1130,6 +1130,12 @@ static int _lvconvert_mirrors_parse_params(struct cmd_context *cmd,
*old_mimage_count = lv_mirror_count(lv);
*old_log_count = _get_log_count(lv);
+ if (is_lockd_type(lv->vg->lock_type) && arg_count(cmd, splitmirrors_ARG)) {
+ /* FIXME: we need to create a lock for the new LV. */
+ log_error("Unable to split mirrors in VG with lock_type %s", lv->vg->lock_type);
+ return 0;
+ }
+
/*
* Collapsing a stack of mirrors:
*
@@ -1838,6 +1844,12 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
return 0;
}
+ if (is_lockd_type(vg->lock_type)) {
+ /* FIXME: we need to create a lock for the new LV. */
+ log_error("Unable to split snapshots in VG with lock_type %s", vg->lock_type);
+ return 0;
+ }
+
if (!vg_check_status(vg, LVM_WRITE))
return_0;
8 years, 9 months
master - lockd: disable part of lock_args validation
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0823511262bd52...
Commit: 0823511262bd52bb14b150a180fcd23ea35fc8fb
Parent: 738ae4a77f3e28b408c2a401ebce6db6949395b0
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 10 11:41:29 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 10 15:53:21 2015 -0500
lockd: disable part of lock_args validation
There are at least a couple instances where
the lock_args check does not work correctly,
(listed in the comment), so disable the
NULL check for lock_args until those are
resolved.
---
lib/locking/lvmlockd.c | 55 +++++++++++++++++++++++++++++++++++++++-------
lib/metadata/metadata.c | 40 +++++++++++++++++++++++++++++++--
2 files changed, 83 insertions(+), 12 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index b861334..99fc047 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -2444,15 +2444,52 @@ out:
int lockd_lv_uses_lock(struct logical_volume *lv)
{
- if (!lv_is_visible(lv) ||
- lv_is_thin_volume(lv) ||
- lv_is_thin_pool_data(lv) ||
- lv_is_thin_pool_metadata(lv) ||
- lv_is_pool_metadata_spare(lv) ||
- lv_is_cache_pool(lv) ||
- lv_is_cache_pool_data(lv) ||
- lv_is_cache_pool_metadata(lv) ||
- lv_is_lockd_sanlock_lv(lv))
+ if (lv_is_thin_volume(lv))
return 0;
+
+ if (lv_is_thin_pool_data(lv))
+ return 0;
+
+ if (lv_is_thin_pool_metadata(lv))
+ return 0;
+
+ if (lv_is_pool_metadata_spare(lv))
+ return 0;
+
+ if (lv_is_cache_pool(lv))
+ return 0;
+
+ if (lv_is_cache_pool_data(lv))
+ return 0;
+
+ if (lv_is_cache_pool_metadata(lv))
+ return 0;
+
+ if (lv_is_cow(lv))
+ return 0;
+
+ if (lv->status & SNAPSHOT)
+ return 0;
+
+ /* FIXME: lv_is_virtual_origin ? */
+
+ if (lv_is_lockd_sanlock_lv(lv))
+ return 0;
+
+ if (lv_is_mirror_image(lv))
+ return 0;
+
+ if (lv_is_mirror_log(lv))
+ return 0;
+
+ if (lv_is_raid_image(lv))
+ return 0;
+
+ if (lv_is_raid_metadata(lv))
+ return 0;
+
+ if (!lv_is_visible(lv))
+ return 0;
+
return 1;
}
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index b0aa122..c4974de 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -2899,7 +2899,7 @@ int vg_validate(struct volume_group *vg)
r = 0;
}
- if (!vg->skip_validate_lock_args && !_validate_vg_lock_args(vg))
+ if (!_validate_vg_lock_args(vg))
r = 0;
} else {
if (vg->lock_args) {
@@ -2915,10 +2915,44 @@ int vg_validate(struct volume_group *vg)
if (vg->skip_validate_lock_args)
continue;
+ /*
+ * FIXME: make missing lock_args an error.
+ * There are at least two cases where this
+ * check doesn't work correctly:
+ *
+ * 1. When creating a cow snapshot,
+ * (lvcreate -s -L1M -n snap1 vg/lv1),
+ * lockd_lv_uses_lock() uses lv_is_cow()
+ * which depends on lv->snapshot being
+ * set, but it's not set at this point,
+ * so lockd_lv_uses_lock() cannot identify
+ * the LV as a cow_lv, and thinks it needs
+ * a lock when it doesn't. To fix this we
+ * probably need to validate by finding the
+ * origin LV, then finding all its snapshots
+ * which will have no lock_args.
+ *
+ * 2. When converting an LV to a thin pool
+ * without using an existing metadata LV,
+ * (lvconvert --type thin-pool vg/poolX),
+ * there is an intermediate LV created,
+ * probably for the metadata LV, and
+ * validate is called on the VG in this
+ * intermediate state, which finds the
+ * newly created LV which is not yet
+ * identified as a metadata LV, and
+ * does not have any lock_args. To fix
+ * this we might be able to find the place
+ * where the intermediate LV is created,
+ * and set new variable on it like for vgs,
+ * lv->skip_validate_lock_args.
+ */
if (!lvl->lv->lock_args) {
- log_error(INTERNAL_ERROR "LV %s/%s missing lock_args",
- vg->name, lvl->lv->name);
+ /*
+ log_verbose("LV %s/%s missing lock_args",
+ vg->name, lvl->lv->name);
r = 0;
+ */
continue;
}
8 years, 9 months
master - lvmpolld: Fix segfault on 32 bit architectures
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=738ae4a77f3e28...
Commit: 738ae4a77f3e28b408c2a401ebce6db6949395b0
Parent: 47ac6a1a2eedd191ac69dea45490f8104b596fc5
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Fri Jul 10 11:50:06 2015 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Fri Jul 10 16:16:57 2015 +0200
lvmpolld: Fix segfault on 32 bit architectures
Explicit conversions are needed to align writes and reads on the stack.
int64_t is popped from stack while int was pushed.
---
WHATS_NEW | 1 +
daemons/lvmpolld/lvmpolld-core.c | 2 +-
lib/lvmpolld/lvmpolld-client.c | 6 +++---
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f3da3e0..4fd027c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.126 -
================================
+ Fix lvmpolld segfaults on 32 bit architectures.
Fix ignored --startstopservices option if running lvmconf with systemd.
Version 2.02.125 - 7th July 2015
diff --git a/daemons/lvmpolld/lvmpolld-core.c b/daemons/lvmpolld/lvmpolld-core.c
index 9d46c7e..1da2da2 100644
--- a/daemons/lvmpolld/lvmpolld-core.c
+++ b/daemons/lvmpolld/lvmpolld-core.c
@@ -529,7 +529,7 @@ static response progress_info(client_handle h, struct lvmpolld_state *ls, reques
if (st.polling_finished)
r = daemon_reply_simple(LVMPD_RESP_FINISHED,
"reason = %s", st.cmd_state.signal ? LVMPD_REAS_SIGNAL : LVMPD_REAS_RETCODE,
- LVMPD_PARM_VALUE " = %d", st.cmd_state.signal ?: st.cmd_state.retcode,
+ LVMPD_PARM_VALUE " = %d", (int64_t)(st.cmd_state.signal ?: st.cmd_state.retcode),
NULL);
else
r = daemon_reply_simple(LVMPD_RESP_IN_PROGRESS, NULL);
diff --git a/lib/lvmpolld/lvmpolld-client.c b/lib/lvmpolld/lvmpolld-client.c
index 8be2d7b..f7faa8b 100644
--- a/lib/lvmpolld/lvmpolld-client.c
+++ b/lib/lvmpolld/lvmpolld-client.c
@@ -147,7 +147,7 @@ static struct progress_info _request_progress_info(const char *uuid, unsigned ab
}
if (abort_polling &&
- !daemon_request_extend(req, LVMPD_PARM_ABORT " = %d", abort_polling, NULL)) {
+ !daemon_request_extend(req, LVMPD_PARM_ABORT " = %d", (int64_t)abort_polling, NULL)) {
log_error("Failed to create " LVMPD_REQ_PROGRESS " request.");
goto out_req;
}
@@ -228,14 +228,14 @@ static int _process_poll_init(const struct cmd_context *cmd, const char *poll_ty
}
if (parms->aborting &&
- !(daemon_request_extend(req, LVMPD_PARM_ABORT " = %d", parms->aborting, NULL))) {
+ !(daemon_request_extend(req, LVMPD_PARM_ABORT " = %d", (int64_t)(parms->aborting), NULL))) {
log_error("Failed to create %s request." , poll_type);
goto out_req;
}
if (cmd->handles_missing_pvs &&
!(daemon_request_extend(req, LVMPD_PARM_HANDLE_MISSING_PVS " = %d",
- cmd->handles_missing_pvs, NULL))) {
+ (int64_t)(cmd->handles_missing_pvs), NULL))) {
log_error("Failed to create %s request." , poll_type);
goto out_req;
}
8 years, 9 months
master - test: Fix syntax error in prepare_devs
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=47ac6a1a2eedd1...
Commit: 47ac6a1a2eedd191ac69dea45490f8104b596fc5
Parent: 3d2c4dc034d685a8d1cf07131a2194ac925852ef
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Fri Jul 10 14:59:15 2015 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Fri Jul 10 16:15:15 2015 +0200
test: Fix syntax error in prepare_devs
---
test/lib/aux.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 459e7f1..f870501 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -545,7 +545,7 @@ prepare_devs() {
# sanlock requires more space for the internal sanlock lv
# This could probably be lower, but what are the units?
if test -n "$LVM_TEST_LOCK_TYPE_SANLOCK" ; then
- devsize = 1024
+ devsize=1024
fi
touch DEVICES
8 years, 9 months
master - metadata: fix duplicated LV flag
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3d2c4dc034d685...
Commit: 3d2c4dc034d685a8d1cf07131a2194ac925852ef
Parent: 082fcc53cc82e77e42af014623f8d9df4f1be173
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jul 9 17:02:30 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jul 9 17:02:30 2015 -0500
metadata: fix duplicated LV flag
LOCKD_SANLOCK_LV was using the WRITEMOSTLY flag instead of a new one.
---
lib/metadata/metadata-exported.h | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 63a57ca..03f959d 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -101,8 +101,6 @@
#define THIN_POOL_DATA UINT64_C(0x0000004000000000) /* LV - Internal use only */
#define THIN_POOL_METADATA UINT64_C(0x0000008000000000) /* LV - Internal use only */
#define POOL_METADATA_SPARE UINT64_C(0x0000010000000000) /* LV - Internal use only */
-#define LOCKD_SANLOCK_LV UINT64_C(0x0000020000000000) /* LV - Internal use only */
-
#define LV_WRITEMOSTLY UINT64_C(0x0000020000000000) /* LV (RAID1) */
#define LV_ACTIVATION_SKIP UINT64_C(0x0000040000000000) /* LV */
@@ -133,7 +131,8 @@
#define PV_ALLOCATION_PROHIBITED UINT64_C(0x0010000000000000) /* PV - internal use only - allocation prohibited
e.g. to prohibit allocation of a RAID image
on a PV already holing an image of the RAID set */
-/* Next unused flag: UINT64_C(0x0080000000000000) */
+#define LOCKD_SANLOCK_LV UINT64_C(0x0080000000000000) /* LV - Internal use only */
+/* Next unused flag: UINT64_C(0x0100000000000000) */
/* Format features flags */
#define FMT_SEGMENTS 0x00000001U /* Arbitrary segment params? */
8 years, 9 months