master - cleanup: add missing log_error
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9f9a196dc0ca12...
Commit: 9f9a196dc0ca12a7bbb98d2e1dd66bb5603f7226
Parent: 5e52a7788f71aa0b1235193902163f7e77f817c1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 10 10:49:14 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 10 10:51:26 2014 +0200
cleanup: add missing log_error
log_error about no change in volume group with 'n' prompt answer.
(in-release fix)
---
tools/vgchange.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 2556af2..88dc180 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -322,14 +322,18 @@ static int _vgchange_clustered(struct cmd_context *cmd,
if (yes_no_prompt("LVM cluster daemon (clvmd) is not"
" running.\n"
"Make volume group \"%s\" clustered"
- " anyway? [y/n]: ", vg->name) == 'n')
+ " anyway? [y/n]: ", vg->name) == 'n') {
+ log_error("No volume groups changed.");
return 0;
+ }
} else if (!locking_is_clustered() &&
(yes_no_prompt("LVM locking type is not clustered.\n"
"Make volume group \"%s\" clustered"
- " anyway? [y/n]: ", vg->name) == 'n'))
+ " anyway? [y/n]: ", vg->name) == 'n')) {
+ log_error("No volume groups changed.");
return 0;
+ }
}
if (!vg_set_clustered(vg, clustered))
9 years, 10 months
master - cleanup: drop inline keyword
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5e52a7788f71aa...
Commit: 5e52a7788f71aa0b1235193902163f7e77f817c1
Parent: 2f260c99096c9db4aa6c3d3623739d18c203e1b4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 10 10:46:04 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 10 10:51:26 2014 +0200
cleanup: drop inline keyword
Inline would need function body in header file.
---
lib/misc/lvm-wrappers.c | 18 ++++++------------
lib/misc/lvm-wrappers.h | 4 ++--
2 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/lib/misc/lvm-wrappers.c b/lib/misc/lvm-wrappers.c
index 4e3ff33..ed84bec 100644
--- a/lib/misc/lvm-wrappers.c
+++ b/lib/misc/lvm-wrappers.c
@@ -140,26 +140,20 @@ unsigned lvm_even_rand(unsigned *seed, unsigned max)
return ret;
}
-#ifdef CLVMD_PIDFILE
-inline int clvmd_is_running(void)
+int clvmd_is_running(void)
{
+#ifdef CLVMD_PIDFILE
return dm_daemon_is_running(CLVMD_PIDFILE);
-}
#else
-inline int clvmd_is_running(void)
-{
return 0;
-}
#endif
+}
-#ifdef CMIRRORD_PIDFILE
-inline int cmirrord_is_running(void)
+int cmirrord_is_running(void)
{
+#ifdef CMIRRORD_PIDFILE
return dm_daemon_is_running(CMIRRORD_PIDFILE);
-}
#else
-inline int cmirrord_is_running(void)
-{
return 0;
-}
#endif
+}
diff --git a/lib/misc/lvm-wrappers.h b/lib/misc/lvm-wrappers.h
index fbf28b8..d147a99 100644
--- a/lib/misc/lvm-wrappers.h
+++ b/lib/misc/lvm-wrappers.h
@@ -37,8 +37,8 @@ int read_urandom(void *buf, size_t len);
*/
unsigned lvm_even_rand(unsigned *seed, unsigned max);
-inline int clvmd_is_running(void);
-inline int cmirrord_is_running(void);
+int clvmd_is_running(void);
+int cmirrord_is_running(void);
#endif
9 years, 10 months
master - activation: retry cleanup deactivation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2f260c99096c9d...
Commit: 2f260c99096c9db4aa6c3d3623739d18c203e1b4
Parent: 1824a781db2dcdb328ba61893a1ace192cb78775
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 9 10:58:57 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 10 10:51:24 2014 +0200
activation: retry cleanup deactivation
Enable 'retry' deactivation also in 'cleanup' phase.
It shouldn't be mostly needed - however udev now produces
more and more completelny non-synchronizable device opens,
so even for orphan devices we can't easily predict where
udevd opens devices.
So it's more preferable here to log error about device being open
and retry clean, but let the command proceed.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 65cac33..4310dd1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Use retry_deactivation also when cleaning orphan devices.
Prompt when setting the VG cluster attr if the cluster is not setup.
Allow --yes to skip prompt in vgextend (worked only with -f).
Don't use name mangling for LVM - it never uses dm names with wrong char set.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index cfceab5..22b13ec 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -2816,6 +2816,8 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv,
/* Only process nodes with uuid of "LVM-" plus VG id. */
switch(action) {
case CLEAN:
+ if (retry_deactivation())
+ dm_tree_retry_remove(root);
/* Deactivate any unused non-toplevel nodes */
if (!_clean_tree(dm, root, laopts->origin_only ? dlid : NULL))
goto_out;
9 years, 10 months
master - lvmetad: Drop active connection upon lvmetad_set_active(0).
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1824a781db2dcd...
Commit: 1824a781db2dcdb328ba61893a1ace192cb78775
Parent: 488f3085279e24af21e870d5a74d0953094552f7
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Jun 9 01:55:33 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Mon Jun 9 01:55:33 2014 +0200
lvmetad: Drop active connection upon lvmetad_set_active(0).
---
lib/cache/lvmetad.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index c03590e..7896ddd 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -101,6 +101,8 @@ int lvmetad_active(void)
void lvmetad_set_active(int active)
{
_lvmetad_use = active;
+ if (!active && lvmetad_active())
+ lvmetad_disconnect();
}
/*
9 years, 10 months
master - libdaemon: Keep track of client threads, wait before shutdown.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=488f3085279e24...
Commit: 488f3085279e24af21e870d5a74d0953094552f7
Parent: 4bb1efe2fbcbd5702836e2c97e9aa3a1eed88847
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Jun 9 01:50:57 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Mon Jun 9 01:50:57 2014 +0200
libdaemon: Keep track of client threads, wait before shutdown.
---
libdaemon/server/daemon-server.c | 67 +++++++++++++++++++++++--------------
libdaemon/server/daemon-server.h | 10 ++++++
2 files changed, 52 insertions(+), 25 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 919f7df..0ea3f69 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -395,11 +395,6 @@ end:
return res;
}
-struct thread_baton {
- daemon_state s;
- client_handle client;
-};
-
static response builtin_handler(daemon_state s, client_handle h, request r)
{
const char *rq = daemon_request_str(r, "request", "NONE");
@@ -414,17 +409,16 @@ static response builtin_handler(daemon_state s, client_handle h, request r)
return res;
}
-static void *client_thread(void *baton)
+static void *client_thread(void *state)
{
- struct thread_baton *b = baton;
+ thread_state *ts = state;
request req;
response res;
- b->client.thread_id = pthread_self();
buffer_init(&req.buffer);
while (1) {
- if (!buffer_read(b->client.socket_fd, &req.buffer))
+ if (!buffer_read(ts->client.socket_fd, &req.buffer))
goto fail;
req.cft = dm_config_from_string(req.buffer.mem);
@@ -432,12 +426,12 @@ static void *client_thread(void *baton)
if (!req.cft)
fprintf(stderr, "error parsing request:\n %s\n", req.buffer.mem);
else
- daemon_log_cft(b->s.log, DAEMON_LOG_WIRE, "<- ", req.cft->root);
+ daemon_log_cft(ts->s.log, DAEMON_LOG_WIRE, "<- ", req.cft->root);
- res = builtin_handler(b->s, b->client, req);
+ res = builtin_handler(ts->s, ts->client, req);
if (res.error == EPROTO) /* Not a builtin, delegate to the custom handler. */
- res = b->s.handler(b->s, b->client, req);
+ res = ts->s.handler(ts->s, ts->client, req);
if (!res.buffer.mem) {
if (!dm_config_write_node(res.cft->root, buffer_line, &res.buffer))
@@ -451,54 +445,72 @@ static void *client_thread(void *baton)
dm_config_destroy(req.cft);
buffer_destroy(&req.buffer);
- daemon_log_multi(b->s.log, DAEMON_LOG_WIRE, "-> ", res.buffer.mem);
- buffer_write(b->client.socket_fd, &res.buffer);
+ daemon_log_multi(ts->s.log, DAEMON_LOG_WIRE, "-> ", res.buffer.mem);
+ buffer_write(ts->client.socket_fd, &res.buffer);
buffer_destroy(&res.buffer);
}
fail:
/* TODO what should we really do here? */
- if (close(b->client.socket_fd))
+ if (close(ts->client.socket_fd))
perror("close");
buffer_destroy(&req.buffer);
- dm_free(baton);
+ ts->active = 0;
return NULL;
}
static int handle_connect(daemon_state s)
{
- struct thread_baton *baton;
+ thread_state *ts;
struct sockaddr_un sockaddr;
client_handle client = { .thread_id = 0 };
socklen_t sl = sizeof(sockaddr);
- pthread_t tid;
client.socket_fd = accept(s.socket_fd, (struct sockaddr *) &sockaddr, &sl);
if (client.socket_fd < 0)
return 0;
- if (!(baton = dm_malloc(sizeof(struct thread_baton)))) {
+ if (!(ts = dm_malloc(sizeof(thread_state)))) {
if (close(client.socket_fd))
perror("close");
- ERROR(&s, "Failed to allocate thread baton");
+ ERROR(&s, "Failed to allocate thread state");
return 0;
}
- baton->s = s;
- baton->client = client;
+ ts->next = s.threads->next;
+ s.threads->next = ts;
- if (pthread_create(&tid, NULL, client_thread, baton))
- return 0;
+ ts->active = 1;
+ ts->s = s;
+ ts->client = client;
- pthread_detach(tid);
+ if (pthread_create(&ts->client.thread_id, NULL, client_thread, ts))
+ return 0;
return 1;
}
+static void reap(daemon_state s, int wait)
+{
+ thread_state *last = s.threads, *ts = last->next;
+ void *rv;
+
+ while (ts) {
+ if (wait || !ts->active) {
+ pthread_join(ts->client.thread_id, &rv);
+ last->next = ts->next;
+ dm_free(ts);
+ } else
+ last = ts;
+ ts = last->next;
+ }
+}
+
void daemon_start(daemon_state s)
{
int failed = 0;
log_state _log = { { 0 } };
+ thread_state _threads = { .next = NULL };
/*
* Switch to C locale to avoid reading large locale-archive file used by
@@ -517,6 +529,7 @@ void daemon_start(daemon_state s)
s.log = &_log;
s.log->name = s.name;
+ s.threads = &_threads;
/* Log important things to syslog by default. */
daemon_log_enable(s.log, DAEMON_LOG_OUTLET_SYSLOG, DAEMON_LOG_FATAL, 1);
@@ -572,8 +585,12 @@ void daemon_start(daemon_state s)
if (FD_ISSET(s.socket_fd, &in))
if (!_shutdown_requested && !handle_connect(s))
ERROR(&s, "Failed to handle a client connection.");
+ reap(s, 0);
}
+ INFO(&s, "%s waiting for client threads to finish", s.name);
+ reap(s, 1);
+
/* If activated by systemd, do not unlink the socket - systemd takes care of that! */
if (!_systemd_activation && s.socket_fd >= 0)
if (unlink(s.socket_path))
diff --git a/libdaemon/server/daemon-server.h b/libdaemon/server/daemon-server.h
index ad41372..a7673d4 100644
--- a/libdaemon/server/daemon-server.h
+++ b/libdaemon/server/daemon-server.h
@@ -70,6 +70,8 @@ typedef struct {
const char *name;
} log_state;
+struct thread_state;
+
typedef struct daemon_state {
/*
* The maximal stack size for individual daemon threads. This is
@@ -95,9 +97,17 @@ typedef struct daemon_state {
int socket_fd;
log_state *log;
+ struct thread_state *threads;
void *private; /* the global daemon state */
} daemon_state;
+typedef struct thread_state {
+ daemon_state s;
+ client_handle client;
+ struct thread_state *next;
+ volatile int active;
+} thread_state;
+
/*
* Start serving the requests. This does all the daemonisation, socket setup
* work and so on. This function takes over the process, and upon failure, it
9 years, 10 months
master - test: Reflect that --sysinit only treats lvmetad specially with -aay (not -ay).
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4bb1efe2fbcbd5...
Commit: 4bb1efe2fbcbd5702836e2c97e9aa3a1eed88847
Parent: ee200ddfc376bbfb332439f64ced54ce450535dd
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Sun Jun 8 23:37:08 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Sun Jun 8 23:37:08 2014 +0200
test: Reflect that --sysinit only treats lvmetad specially with -aay (not -ay).
---
test/shell/lvmetad-override.sh | 2 +-
test/shell/lvmetad-warning.sh | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvmetad-override.sh b/test/shell/lvmetad-override.sh
index 8f6e641..fe11658 100644
--- a/test/shell/lvmetad-override.sh
+++ b/test/shell/lvmetad-override.sh
@@ -18,7 +18,7 @@ vgcreate $vg1 $dev1 $dev2
lvchange -ay $vg1 2>&1 | not grep "Failed to connect"
kill $(cat LOCAL_LVMETAD)
lvchange -ay $vg1 2>&1 | grep "Failed to connect"
-lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
+lvchange -aay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
lvchange -ay $vg1 --config 'global { use_lvmetad = 0 }' 2>&1 | not grep "Failed to connect"
aux lvmconf "global/use_lvmetad = 0"
lvchange -ay $vg1 --config 'global { use_lvmetad = 1 }' 2>&1 | grep "Failed to connect"
diff --git a/test/shell/lvmetad-warning.sh b/test/shell/lvmetad-warning.sh
index 8bb01d1..365f70f 100644
--- a/test/shell/lvmetad-warning.sh
+++ b/test/shell/lvmetad-warning.sh
@@ -16,12 +16,16 @@ aux prepare_pvs 2
vgcreate $vg1 "$dev1" "$dev2"
lvchange -ay $vg1 2>&1 | not grep "Failed to connect"
+
kill $(cat LOCAL_LVMETAD)
lvchange -ay $vg1 2>&1 | grep "Failed to connect"
-lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
+lvchange -aay $vg1 --sysinit 2>&1 | tee sysinit.txt
+not grep "Failed to connect" sysinit.txt
+
aux lvmconf 'global/use_lvmetad = 0'
lvchange -ay $vg1 2>&1 | not grep "Failed to connect"
lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
+
aux prepare_lvmetad
lvchange -ay $vg1 2>&1 | not grep "Failed to connect"
lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
9 years, 10 months
master - pvremove: Update lvmcache => avoid spurious error messages.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ee200ddfc376bb...
Commit: ee200ddfc376bbfb332439f64ced54ce450535dd
Parent: 02e1bf406b2fc9731b2f67c273acd8f21df64714
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Sun Jun 8 22:57:04 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Sun Jun 8 22:57:04 2014 +0200
pvremove: Update lvmcache => avoid spurious error messages.
---
lib/cache/lvmcache.c | 5 ++---
lib/metadata/pv_manip.c | 6 ++++++
test/shell/pvremove-warnings.sh | 16 ++++++++++++++++
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index c61bb77..3244205 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1062,7 +1062,6 @@ static int _drop_vginfo(struct lvmcache_info *info, struct lvmcache_vginfo *vgin
return 1;
}
-/* Unused
void lvmcache_del(struct lvmcache_info *info)
{
if (info->dev->pvid[0] && _pvid_hash)
@@ -1071,11 +1070,11 @@ void lvmcache_del(struct lvmcache_info *info)
_drop_vginfo(info, info->vginfo);
info->label->labeller->ops->destroy_label(info->label->labeller,
- info->label);
+ info->label);
dm_free(info);
return;
-} */
+}
static int _lvmcache_update_pvid(struct lvmcache_info *info, const char *pvid)
{
diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c
index 3613515..2717031 100644
--- a/lib/metadata/pv_manip.c
+++ b/lib/metadata/pv_manip.c
@@ -733,6 +733,7 @@ int pvremove_single(struct cmd_context *cmd, const char *pv_name,
unsigned prompt)
{
struct device *dev;
+ struct lvmcache_info *info;
int r = 0;
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE, NULL)) {
@@ -749,6 +750,8 @@ int pvremove_single(struct cmd_context *cmd, const char *pv_name,
goto out;
}
+ info = lvmcache_info_from_pvid(dev->pvid, 1);
+
if (!dev_test_excl(dev)) {
/* FIXME Detect whether device-mapper is still using the device */
log_error("Can't open %s exclusively - not removing. "
@@ -762,6 +765,9 @@ int pvremove_single(struct cmd_context *cmd, const char *pv_name,
goto out;
}
+ if (info)
+ lvmcache_del(info);
+
if (!lvmetad_pv_gone_by_dev(dev, NULL))
goto_out;
diff --git a/test/shell/pvremove-warnings.sh b/test/shell/pvremove-warnings.sh
new file mode 100644
index 0000000..c9b7c6a
--- /dev/null
+++ b/test/shell/pvremove-warnings.sh
@@ -0,0 +1,16 @@
+# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+aux prepare_devs 2
+pvcreate "$dev1" "$dev2"
+pvremove "$dev1" "$dev2" 2>&1 | tee pvremove.txt
+not grep "No physical" pvremove.txt
9 years, 10 months
master - lvmetad: Avoid "connect failed" spamming when lvmetad is not available.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=02e1bf406b2fc9...
Commit: 02e1bf406b2fc9731b2f67c273acd8f21df64714
Parent: 150165591f36e0ba16d9dfdca70c569b3ae03a83
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Sun Jun 8 22:09:29 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Sun Jun 8 22:09:29 2014 +0200
lvmetad: Avoid "connect failed" spamming when lvmetad is not available.
---
lib/cache/lvmetad.c | 20 ++++++--------------
1 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 3470c66..c03590e 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -26,7 +26,7 @@
#define SCAN_TIMEOUT_SECONDS 80
#define MAX_RESCANS 10 /* Maximum number of times to scan all PVs and retry if the daemon returns a token mismatch error */
-static daemon_handle _lvmetad;
+static daemon_handle _lvmetad = { .error = 0 };
static int _lvmetad_use = 0;
static int _lvmetad_connected = 0;
@@ -68,12 +68,12 @@ void lvmetad_connect_or_warn(void)
if (!_lvmetad_use)
return;
- if (!_lvmetad_connected)
+ if (!_lvmetad_connected && !_lvmetad.error) {
_lvmetad_connect();
- if ((_lvmetad.socket_fd < 0 || _lvmetad.error))
- log_warn("WARNING: Failed to connect to lvmetad: %s. Falling back to internal scanning.",
- strerror(_lvmetad.error));
+ if ((_lvmetad.socket_fd < 0 || _lvmetad.error))
+ log_warn("WARNING: Failed to connect to lvmetad. Falling back to internal scanning.");
+ }
}
int lvmetad_used(void)
@@ -94,15 +94,7 @@ int lvmetad_socket_present(void)
int lvmetad_active(void)
{
- if (!_lvmetad_use)
- return 0;
-
- if (!_lvmetad_connected)
- _lvmetad_connect();
-
- if ((_lvmetad.socket_fd < 0 || _lvmetad.error))
- log_debug_lvmetad("Failed to connect to lvmetad: %s.", strerror(_lvmetad.error));
-
+ lvmetad_connect_or_warn();
return _lvmetad_connected;
}
9 years, 10 months
master - test: Try harder to vgremove in lvmetad-lvm1.sh.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=150165591f36e0...
Commit: 150165591f36e0ba16d9dfdca70c569b3ae03a83
Parent: b3bdd410927a3d9b1b17de94a05b1621a79bdb31
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Sun Jun 8 22:01:02 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Sun Jun 8 22:01:02 2014 +0200
test: Try harder to vgremove in lvmetad-lvm1.sh.
---
test/shell/lvmetad-lvm1.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvmetad-lvm1.sh b/test/shell/lvmetad-lvm1.sh
index d41e078..dcff55b 100644
--- a/test/shell/lvmetad-lvm1.sh
+++ b/test/shell/lvmetad-lvm1.sh
@@ -28,4 +28,4 @@ lvcreate -l1 $vg1
pvremove -ff -y $dev2
vgchange -an $vg1
not lvremove $vg1
-not vgremove $vg1
+not vgremove -ff -y $vg1
9 years, 10 months
master - lvm1: Fail vg_write graciously when devices are missing.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b3bdd410927a3d...
Commit: b3bdd410927a3d9b1b17de94a05b1621a79bdb31
Parent: 60443d6a5d17c9f3ba935263a5e14a8548aab509
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Sun Jun 8 21:52:54 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Sun Jun 8 21:57:18 2014 +0200
lvm1: Fail vg_write graciously when devices are missing.
---
lib/format1/disk-rep.c | 3 +++
test/shell/lvmetad-lvm1.sh | 9 +++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/format1/disk-rep.c b/lib/format1/disk-rep.c
index f42d344..32e9f5e 100644
--- a/lib/format1/disk-rep.c
+++ b/lib/format1/disk-rep.c
@@ -727,6 +727,9 @@ static int _write_all_pvd(const struct format_type *fmt, struct disk_list *data,
{
int r;
+ if (!data->dev)
+ return_0;
+
if (!dev_open(data->dev))
return_0;
diff --git a/test/shell/lvmetad-lvm1.sh b/test/shell/lvmetad-lvm1.sh
index 814134c..d41e078 100644
--- a/test/shell/lvmetad-lvm1.sh
+++ b/test/shell/lvmetad-lvm1.sh
@@ -20,3 +20,12 @@ vgcreate --metadatatype 1 $vg1 "$dev1"
should vgscan --cache
vgs | should grep $vg1
pvs | should grep "$dev1"
+
+# check for RHBZ 1080189 -- SEGV in lvremove/vgremove
+pvcreate -ff -y --metadatatype 1 "$dev1" "$dev2"
+vgcreate --metadatatype 1 $vg1 "$dev1" "$dev2"
+lvcreate -l1 $vg1
+pvremove -ff -y $dev2
+vgchange -an $vg1
+not lvremove $vg1
+not vgremove $vg1
9 years, 10 months