master - vgchange: don't disable VG lock in lock_stop
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a0cc570f86ad26...
Commit: a0cc570f86ad267e4903aac9bedaecaf22e8d714
Parent: 903569d53375f8305bcfb8c2a0e9af7c29fa1d46
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jul 8 15:14:28 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 8 15:26:25 2015 -0500
vgchange: don't disable VG lock in lock_stop
It was an optimization to avoid a pointless unlock call.
It affects all VGs, but was only intended to affect the
VG being stopped.
---
tools/vgchange.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 92c854b..437dbae 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -873,8 +873,6 @@ do_start:
static int _vgchange_lock_stop(struct cmd_context *cmd, struct volume_group *vg)
{
- /* Disable the unlock in toollib because it's pointless after the stop. */
- cmd->lockd_vg_disable = 1;
return lockd_stop_vg(cmd, vg);
}
8 years, 10 months
master - lvmlockd: remove log_error instances for normal conditions
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=903569d53375f8...
Commit: 903569d53375f8305bcfb8c2a0e9af7c29fa1d46
Parent: d77546773bfe0dd2db98427d6b5b16fa4f19e47a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jul 8 13:23:48 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 8 15:25:14 2015 -0500
lvmlockd: remove log_error instances for normal conditions
There are a number of log_error instances that are replaced
by log_debug because they are not errors.
---
daemons/lvmlockd/lvmlockd-core.c | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index 73a2fb3..1b7f494 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -1850,10 +1850,16 @@ static int clear_locks(struct lockspace *ls, int free_vg)
list_for_each_entry_safe(lk, lk_safe, &r->locks, list) {
lk_count++;
+ /*
+ * Stopping a lockspace shouldn't happen with LV locks
+ * still held, but it will be stopped with GL and VG
+ * locks held.
+ */
+
if (lk->flags & LD_LF_PERSISTENT)
log_error("S %s R %s clear lock persistent", ls->name, r->name);
else
- log_error("S %s R %s clear lock client %d", ls->name, r->name, lk->client_id);
+ log_debug("S %s R %s clear lock mode %s client %d", ls->name, r->name, mode_str(lk->mode), lk->client_id);
if (lk->version > lk_version)
lk_version = lk->version;
@@ -2356,17 +2362,14 @@ static int vg_ls_name(const char *vg_name, char *ls_name)
/* FIXME: add mutex for gl_lsname_ ? */
-static int gl_ls_name(char *ls_name)
+static void gl_ls_name(char *ls_name)
{
if (gl_use_dlm)
memcpy(ls_name, gl_lsname_dlm, MAX_NAME);
else if (gl_use_sanlock)
memcpy(ls_name, gl_lsname_sanlock, MAX_NAME);
- else {
- log_error("gl_ls_name: global lockspace type unknown");
- return -1;
- }
- return 0;
+ else
+ memset(ls_name, 0, MAX_NAME);
}
/*
@@ -3482,7 +3485,8 @@ static int add_lock_action(struct action *act)
int ls_inactive = 0;
int ls_create_fail = 0;
- ls = find_lockspace_inactive(ls_name);
+ if (ls_name[0])
+ ls = find_lockspace_inactive(ls_name);
if (ls) {
ls_inactive = 1;
ls_create_fail = ls->create_fail;
@@ -3496,7 +3500,7 @@ static int add_lock_action(struct action *act)
} else if (act->flags & LD_AF_SEARCH_LS) {
/* fail if we've already tried searching for the ls */
- log_error("lockspace search repeated %s", ls_name);
+ log_debug("lockspace search repeated %s", ls_name);
return -ENOLS;
} else if (act->op == LD_OP_LOCK && act->rt == LD_RT_GL && gl_use_sanlock) {
@@ -3528,7 +3532,7 @@ static int add_lock_action(struct action *act)
return -ENOLS;
} else {
- log_error("lockspace not found %s", ls_name);
+ log_debug("lockspace not found %s", ls_name);
return -ENOLS;
}
}
8 years, 10 months
master - man: add lvmlocal.conf to config cascade
by Andy Grover
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d77546773bfe0d...
Commit: d77546773bfe0dd2db98427d6b5b16fa4f19e47a
Parent: de13abdfdf44c1119ee03c2514dd886191f3d9c3
Author: Andy Grover <agrover(a)redhat.com>
AuthorDate: Wed Jul 8 10:02:28 2015 -0700
Committer: Andy Grover <agrover(a)redhat.com>
CommitterDate: Wed Jul 8 10:02:28 2015 -0700
man: add lvmlocal.conf to config cascade
see BZ 1241182, lvmlocal is searched before lvm.conf but after
lvm_<tag>.conf.
---
man/lvm.conf.5.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 6ff8674..ae884be 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -87,7 +87,7 @@ When several configuration methods are used at the same time
and when LVM looks for the value of a particular setting, it traverses
this \fBconfig cascade\fP from left to right:
-\fBdirect config override on command line\fP -> \fBcommand profile config\fP -> \fBmetadata profile config\fP -> \fBtag config\fP -> \fBlvm.conf\fP
+\fBdirect config override on command line\fP -> \fBcommand profile config\fP -> \fBmetadata profile config\fP -> \fBtag config\fP -> \fBlvmlocal.conf\fB -> \fBlvm.conf\fP
No part of this cascade is compulsory. If there's no setting value found at
the end of the cascade, a default value is used for that setting.
8 years, 10 months
master - lvmlockd: fix unreachable code
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=de13abdfdf44c1...
Commit: de13abdfdf44c1119ee03c2514dd886191f3d9c3
Parent: 2566bdfbc3dd1ca7296d8828bb4235c18e06672e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jul 8 11:02:11 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 8 11:02:11 2015 -0500
lvmlockd: fix unreachable code
---
daemons/lvmlockd/lvmlockd-core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index b247bb5..73a2fb3 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -920,9 +920,9 @@ static int lm_unlock(struct lockspace *ls, struct resource *r, struct action *ac
int rv;
if (ls->lm_type == LD_LM_DLM)
- return lm_unlock_dlm(ls, r, r_version, lmu_flags);
+ rv = lm_unlock_dlm(ls, r, r_version, lmu_flags);
else if (ls->lm_type == LD_LM_SANLOCK)
- return lm_unlock_sanlock(ls, r, r_version, lmu_flags);
+ rv = lm_unlock_sanlock(ls, r, r_version, lmu_flags);
else
return -1;
8 years, 10 months
master - lvmlockctl: fix uninitialized names
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2566bdfbc3dd1c...
Commit: 2566bdfbc3dd1ca7296d8828bb4235c18e06672e
Parent: 143a9d7ee690c68269572a44f4f1e396916c9b57
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jul 8 10:57:57 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 8 10:58:56 2015 -0500
lvmlockctl: fix uninitialized names
When formatting and printing info from lvmlockd.
Also fix some new line problems.
---
daemons/lvmlockd/lvmlockctl.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockctl.c b/daemons/lvmlockd/lvmlockctl.c
index 33f0a6f..bc5ec78 100644
--- a/daemons/lvmlockd/lvmlockctl.c
+++ b/daemons/lvmlockd/lvmlockctl.c
@@ -135,7 +135,7 @@ static void format_info_ls_action(char *line)
find_client_info(client_id, &pid, cl_name);
- printf("OP %s pid %u (%s)", op, pid, cl_name);
+ printf("OP %s pid %u (%s)\n", op, pid, cl_name);
}
static void format_info_r(char *line, char *r_name_out, char *r_type_out)
@@ -242,13 +242,10 @@ static void format_info_r_action(char *line, char *r_name, char *r_type)
}
}
-static void format_info_line(char *line)
+static void format_info_line(char *line, char *r_name, char *r_type)
{
- char r_name[MAX_NAME+1];
- char r_type[MAX_NAME+1];
-
if (!strncmp(line, "info=structs ", strlen("info=structs "))) {
- printf("%s\n", line);
+ printf("%s", line);
} else if (!strncmp(line, "info=client ", strlen("info=client "))) {
save_client_info(line);
@@ -260,8 +257,13 @@ static void format_info_line(char *line)
format_info_ls_action(line);
} else if (!strncmp(line, "info=r ", strlen("info=r "))) {
- memset(r_name, 0, sizeof(r_name));
- memset(r_type, 0, sizeof(r_type));
+ /*
+ * r_name/r_type are reset when a new resource is found.
+ * They are reused for the lock and action lines that
+ * follow a resource line.
+ */
+ memset(r_name, 0, MAX_NAME+1);
+ memset(r_type, 0, MAX_NAME+1);
format_info_r(line, r_name, r_type);
} else if (!strncmp(line, "info=lk ", strlen("info=lk "))) {
@@ -270,7 +272,6 @@ static void format_info_line(char *line)
} else if (!strncmp(line, "info=r_action ", strlen("info=r_action "))) {
/* will use info from previous r */
- /* FIXME: r_name and r_type uninitialized here??? */
format_info_r_action(line, r_name, r_type);
} else {
printf("UN %s\n", line);
@@ -280,6 +281,8 @@ static void format_info_line(char *line)
static void format_info(void)
{
char line[MAX_LINE];
+ char r_name[MAX_NAME+1];
+ char r_type[MAX_NAME+1];
int i, j;
j = 0;
@@ -289,7 +292,7 @@ static void format_info(void)
line[j++] = dump_buf[i];
if ((line[j-1] == '\n') || (line[j-1] == '\0')) {
- format_info_line(line);
+ format_info_line(line, r_name, r_type);
j = 0;
memset(line, 0, sizeof(line));
}
8 years, 10 months
master - toollib: skip processing the sanlock LV unless named or all
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=143a9d7ee690c6...
Commit: 143a9d7ee690c68269572a44f4f1e396916c9b57
Parent: 6e1f421a6d3a515a9720514bbcceb6789f96dd44
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jul 7 16:04:18 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 8 10:27:21 2015 -0500
toollib: skip processing the sanlock LV unless named or all
This prevents 'lvremove vgname' from attempting to remove the
hidden sanlock LV. Only vgremove should remove the hidden
sanlock LV holding the sanlock locks.
---
tools/toollib.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 8c301bb..b0b2b01 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2135,13 +2135,26 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
}
/*
- * Only let hidden LVs through it --all was used or the LVs
+ * Only let hidden LVs through if --all was used or the LVs
* were specifically named on the command line.
*/
if (!lvargs_supplied && !lv_is_visible(lvl->lv) && !arg_count(cmd, all_ARG))
continue;
/*
+ * Only let sanlock LV through if --all was used or if
+ * it is named on the command line.
+ */
+ if (lv_is_lockd_sanlock_lv(lvl->lv)) {
+ if (arg_count(cmd, all_ARG) ||
+ (lvargs_supplied && str_list_match_item(arg_lvnames, lvl->lv->name))) {
+ log_very_verbose("Processing lockd_sanlock_lv %s/%s.", vg->name, lvl->lv->name);
+ } else {
+ continue;
+ }
+ }
+
+ /*
* process the LV if one of the following:
* - process_all is set
* - LV name matches a supplied LV name
8 years, 10 months
master - tests: follow symlinks
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6e1f421a6d3a51...
Commit: 6e1f421a6d3a515a9720514bbcceb6789f96dd44
Parent: fd37eeddd6b3901da806d536f44d43070e4fb660
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jul 8 15:14:09 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jul 8 15:41:48 2015 +0200
tests: follow symlinks
If the srcdir itself is a symlink the find would not return expected
value. So support also this config and use -L.
---
test/Makefile.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index bba33db..72eb4e6 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -36,9 +36,9 @@ include $(top_builddir)/make.tmpl
T ?= .
S ?= @ # never match anything by default
VERBOSE ?= 0
-ALL := $(shell find $(srcdir) \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) | sort)
+ALL := $(shell find -L $(srcdir) \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) | sort)
comma = ,
-RUN := $(shell find $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | sort)
+RUN := $(shell find -L $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | sort)
RUN_BASE = $(subst $(srcdir)/,,$(RUN))
ifeq ("@BUILD_LVMETAD@", "yes")
8 years, 10 months
master - coverity: fix regresions from 16e9b32c2f1
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fd37eeddd6b390...
Commit: fd37eeddd6b3901da806d536f44d43070e4fb660
Parent: 6b48233f2548621c42129b8f0e2911e05c206660
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jul 8 15:35:37 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jul 8 15:41:48 2015 +0200
coverity: fix regresions from 16e9b32c2f1
16e9b32c2f1a2d7e0f05a88981824ef0e7607965 incorrectly moved
free of opened descriptor out of if{} - resulted of
closing random file handle.
---
lib/log/log.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/log/log.c b/lib/log/log.c
index e3570d4..a439d1d 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -101,10 +101,11 @@ void init_log_file(const char *log_file, int append)
append = 1; /* force */
}
}
+
+ if (st && fclose(st))
+ log_sys_debug("fclose", statfile);
}
- if (st && fclose(st))
- log_sys_debug("fclose", statfile);
no_epoch:
if (!(_log_file = fopen(log_file, append ? "a" : "w"))) {
log_sys_error("fopen", log_file);
8 years, 10 months
master - coverity: fix NULL check in lv->lvid.s
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6b48233f254862...
Commit: 6b48233f2548621c42129b8f0e2911e05c206660
Parent: 3ec4813ba22adedb8914089b6f17fe779d76ee77
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jul 8 15:08:39 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jul 8 15:08:39 2015 +0200
coverity: fix NULL check in lv->lvid.s
tools/polldaemon.c:457: array_null: Comparing an array to null is not useful: "lv->lvid.s"
The lv->lvid.s is never NULL. The check was supposed to be *lv->lvid.s
to check if the string is not empty.
---
tools/polldaemon.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index ab9e474..bbe4641 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -454,7 +454,7 @@ static int _lvmpolld_init_poll_vg(struct cmd_context *cmd, const char *vgname,
if (!id.display_name && !lpdp->parms->aborting)
continue;
- if (!lv->lvid.s) {
+ if (!*lv->lvid.s) {
log_print_unless_silent("Missing LV uuid within: %s/%s", id.vg_name, id.lv_name);
continue;
}
8 years, 10 months
master - coverity: fix missing initialization
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3ec4813ba22ade...
Commit: 3ec4813ba22adedb8914089b6f17fe779d76ee77
Parent: e8dbaf62d3b3e2a175d3b0237a4d85c009d98038
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jul 8 14:53:23 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jul 8 14:53:30 2015 +0200
coverity: fix missing initialization
... Using uninitialized value "lockd_state" when calling "lockd_vg"
(even though lockd_vg assigns 0 to the lockd_state, but it looks at
previous state of lockd_state just before that so we need to have
that properly initialized!)
libdm/libdm-report.c:2934: uninit_use_in_call: Using uninitialized value "tm". Field "tm.tm_gmtoff" is uninitialized when calling "_get_final_time".
daemons/lvmlockd/lvmlockctl.c:273: uninit_use_in_call: Using uninitialized element of array "r_name" when calling "format_info_r_action". (just added FIXME as this looks unfinished?)
---
daemons/lvmlockd/lvmlockctl.c | 1 +
libdm/libdm-report.c | 2 +-
tools/lvconvert.c | 2 +-
tools/lvcreate.c | 2 +-
tools/lvrename.c | 2 +-
tools/lvresize.c | 2 +-
tools/polldaemon.c | 4 ++--
tools/pvmove.c | 4 ++--
tools/toollib.c | 6 +++---
tools/vgreduce.c | 2 +-
tools/vgrename.c | 2 +-
11 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockctl.c b/daemons/lvmlockd/lvmlockctl.c
index 51b5734..33f0a6f 100644
--- a/daemons/lvmlockd/lvmlockctl.c
+++ b/daemons/lvmlockd/lvmlockctl.c
@@ -270,6 +270,7 @@ static void format_info_line(char *line)
} else if (!strncmp(line, "info=r_action ", strlen("info=r_action "))) {
/* will use info from previous r */
+ /* FIXME: r_name and r_type uninitialized here??? */
format_info_r_action(line, r_name, r_type);
} else {
printf("UN %s\n", line);
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 455123f..c08dcab 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -2911,7 +2911,7 @@ static void _get_final_time(time_range_t range, struct tm *tm,
static int _parse_formatted_date_time(char *str, struct time_value *tval)
{
time_range_t range = RANGE_NONE;
- struct tm tm;
+ struct tm tm = {0};
int gmt_offset;
int tz_supplied;
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 528c351..b10798e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3314,7 +3314,7 @@ static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp
struct volume_group *vg;
int ret = ECMD_FAILED;
int saved_ignore_suspended_devices = ignore_suspended_devices();
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
if (arg_count(cmd, repair_ARG)) {
init_ignore_suspended_devices(1);
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index f316767..4019b5d 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1453,7 +1453,7 @@ int lvcreate(struct cmd_context *cmd, int argc, char **argv)
};
struct lvcreate_cmdline_params lcp = { 0 };
struct volume_group *vg;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
if (!_lvcreate_params(cmd, argc, argv, &lp, &lcp)) {
stack;
diff --git a/tools/lvrename.c b/tools/lvrename.c
index 6bbf31b..7b0791a 100644
--- a/tools/lvrename.c
+++ b/tools/lvrename.c
@@ -27,7 +27,7 @@ int lvrename(struct cmd_context *cmd, int argc, char **argv)
char *st;
struct volume_group *vg;
struct lv_list *lvl;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
int r = ECMD_FAILED;
if (argc == 3) {
diff --git a/tools/lvresize.c b/tools/lvresize.c
index 30ac4f9..3188f27 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -169,7 +169,7 @@ int lvresize(struct cmd_context *cmd, int argc, char **argv)
struct volume_group *vg;
struct dm_list *pvh = NULL;
struct logical_volume *lv;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
int r = ECMD_FAILED;
if (!_lvresize_params(cmd, argc, argv, &lp))
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index da890dc..ab9e474 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -139,7 +139,7 @@ int wait_for_single_lv(struct cmd_context *cmd, struct poll_operation_id *id,
struct volume_group *vg;
struct logical_volume *lv;
int finished = 0;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
/* Poll for completion */
while (!finished) {
@@ -369,7 +369,7 @@ static int report_progress(struct cmd_context *cmd, struct poll_operation_id *id
{
struct volume_group *vg;
struct logical_volume *lv;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
int ret;
/*
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 17416d4..70826c6 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -600,7 +600,7 @@ static int _set_up_pvmove(struct cmd_context *cmd, const char *pv_name,
struct dm_list *lvs_changed;
struct physical_volume *pv;
struct logical_volume *lv_mirr;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
unsigned flags = PVMOVE_FIRST_TIME;
unsigned exclusive;
int r = ECMD_FAILED;
@@ -726,7 +726,7 @@ static int _read_poll_id_from_pvname(struct cmd_context *cmd, const char *pv_nam
struct logical_volume *lv;
struct physical_volume *pv;
struct volume_group *vg;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
if (!pv_name) {
log_error(INTERNAL_ERROR "Invalid PV name parameter.");
diff --git a/tools/toollib.c b/tools/toollib.c
index 15bfa51..8c301bb 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1889,7 +1889,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
struct vgnameid_list *vgnl;
const char *vg_name;
const char *vg_uuid;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
int selected;
int whole_selected = 0;
int ret_max = ECMD_PROCESSED;
@@ -2341,7 +2341,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
struct dm_str_list *sl;
struct dm_list *tags_arg;
struct dm_list lvnames;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
const char *vg_name;
const char *vg_uuid;
const char *vgn;
@@ -2873,7 +2873,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t flags,
struct vgnameid_list *vgnl;
const char *vg_name;
const char *vg_uuid;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
diff --git a/tools/vgreduce.c b/tools/vgreduce.c
index 693f538..5d43c94 100644
--- a/tools/vgreduce.c
+++ b/tools/vgreduce.c
@@ -141,7 +141,7 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
{
struct volume_group *vg;
const char *vg_name;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
int ret = ECMD_FAILED;
int fixed = 1;
int repairing = arg_count(cmd, removemissing_ARG);
diff --git a/tools/vgrename.c b/tools/vgrename.c
index 188061b..7e77b57 100644
--- a/tools/vgrename.c
+++ b/tools/vgrename.c
@@ -68,7 +68,7 @@ static int vg_rename_path(struct cmd_context *cmd, const char *old_vg_path,
const char *vgid = NULL, *vg_name, *vg_name_old;
char old_path[NAME_LEN], new_path[NAME_LEN];
struct volume_group *vg = NULL;
- uint32_t lockd_state;
+ uint32_t lockd_state = 0;
int lock_vg_old_first = 1;
vg_name_old = skip_dev_dir(cmd, old_vg_path, NULL);
8 years, 10 months