master - cleanup: monitoring more readable
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=861a3b2f1940cd...
Commit: 861a3b2f1940cd3667cc353c762ff3d1ef75c37b
Parent: cafde608909b87aedeb76f0eda1397f7bf98fea4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Sep 5 11:32:42 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Sep 23 11:35:15 2013 +0200
cleanup: monitoring more readable
Put continue path into one code segment.
---
lib/activate/activate.c | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 7b535c6..ecd35b2 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1514,22 +1514,18 @@ int monitor_dev_for_events(struct cmd_context *cmd, struct logical_volume *lv,
!monitor_dev_for_events(cmd, seg->metadata_lv, NULL, monitor))
r = 0;
- if (!seg_monitored(seg) || (seg->status & PVMOVE))
+ if (!seg_monitored(seg) ||
+ (seg->status & PVMOVE) ||
+ !seg->segtype->ops->target_monitored) /* doesn't support registration */
continue;
- monitor_fn = NULL;
-
- /* Check monitoring status */
- if (seg->segtype->ops->target_monitored)
- monitored = seg->segtype->ops->target_monitored(seg, &pending);
- else
- continue; /* segtype doesn't support registration */
+ monitored = seg->segtype->ops->target_monitored(seg, &pending);
- /*
- * FIXME: We should really try again if pending
- */
+ /* FIXME: We should really try again if pending */
monitored = (pending) ? 0 : monitored;
+ monitor_fn = NULL;
+
if (monitor) {
if (monitored)
log_verbose("%s/%s already monitored.", lv->vg->name, lv->name);
9 years, 6 months
master - test: Blacklist fedora-19 kernel for RAID4/5/6 dev replace tests
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cafde608909b87...
Commit: cafde608909b87aedeb76f0eda1397f7bf98fea4
Parent: bd75844024ad4a2e66c7743c50e189a00c233284
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Fri Sep 20 11:33:29 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Fri Sep 20 11:33:29 2013 -0500
test: Blacklist fedora-19 kernel for RAID4/5/6 dev replace tests
A know issue with kmem_cach is causing failures while testing
RAID 4/5/6 device replacement. Blacklist the offending kernel
so that these tests are not performed there.
---
test/lib/aux.sh | 33 +++++++++++++++++++++++++++++++++
test/shell/lvconvert-raid.sh | 2 ++
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 6194492..7939949 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -615,6 +615,39 @@ skip_if_mirror_recovery_broken() {
if test `uname -r` = 3.3.4-5.fc17.x86_64; then skip; fi
}
+skip_if_raid456_replace_broken() {
+# The way kmem_cache aliasing is done in the kernel is broken.
+# It causes RAID 4/5/6 tests to fail.
+#
+# The problem with kmem_cache* is this:
+# *) Assume CONFIG_SLUB is set
+# 1) kmem_cache_create(name="foo-a")
+# - creates new kmem_cache structure
+# 2) kmem_cache_create(name="foo-b")
+# - If identical cache characteristics, it will be merged with the previously
+# created cache associated with "foo-a". The cache's refcount will be
+# incremented and an alias will be created via sysfs_slab_alias().
+# 3) kmem_cache_destroy(<ptr>)
+# - Attempting to destroy cache associated with "foo-a", but instead the
+# refcount is simply decremented. I don't even think the sysfs aliases are
+# ever removed...
+# 4) kmem_cache_create(name="foo-a")
+# - This FAILS because kmem_cache_sanity_check colides with the existing
+# name ("foo-a") associated with the non-removed cache.
+#
+# This is a problem for RAID (specifically dm-raid) because the name used
+# for the kmem_cache_create is ("raid%d-%p", level, mddev). If the cache
+# persists for long enough, the memory address of an old mddev will be
+# reused for a new mddev - causing an identical formulation of the cache
+# name. Even though kmem_cache_destory had long ago been used to delete
+# the old cache, the merging of caches has cause the name and cache of that
+# old instance to be preserved and causes a colision (and thus failure) in
+# kmem_cache_create(). I see this regularly in testing the following
+# kernels:
+ if test `uname -r` = 3.10.11-200.fc19.i686; then skip; fi
+ if test `uname -r` = 3.10.11-200.fc19.x86_64; then skip; fi
+}
+
udev_wait() {
pgrep udev >/dev/null || return 0
which udevadm >/dev/null || return 0
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index 4c08386..6762db2 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -206,6 +206,8 @@ for i in {1..3}; do
lvremove -ff $vg
done
+aux skip_if_raid456_replace_broken
+
# RAID 4/5/6 (can replace up to 'parity' devices)
for i in 4 5 6; do
lvcreate --type raid$i -i 3 -l 3 -n $lv1 $vg
9 years, 6 months
master - release 2.02.101
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bd75844024ad4a...
Commit: bd75844024ad4a2e66c7743c50e189a00c233284
Parent: f393a5c15631f883883df41e85b3209b33005cd6
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Sep 20 13:56:29 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Sep 20 13:56:29 2013 +0100
release 2.02.101
112 files changed, 4131 insertions(+), 1312 deletions(-)
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 6 ++++--
WHATS_NEW_DM | 4 ++--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index 4aa9105..8c1db53 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.101(2)-git (2013-08-13)
+2.02.101(2)-git (2013-09-20)
diff --git a/VERSION_DM b/VERSION_DM
index 2fe4e25..10b2320 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.80-git (2013-08-13)
+1.02.80-git (2013-09-20)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0b53a9e..e969620 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
-Version 2.02.101 -
-===================================
+Version 2.02.101 - 20th September 2013
+======================================
+ Fix 3-thread clvmd deadlock triggered by cleanup on EOF from client.
+ Remove VG from lvmetad before restoring it with vgcfgrestore.
Use strtoull instead of strtol in _get_int_arg.
Add devtypes report command to display built-in recognised block device types.
Fix CC Makefile override which had reverted to using built-in value. (2.02.75)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 51c771c..176234c 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.80 -
-==================================
+Version 1.02.80 - 20th September 2013
+=====================================
Detect invalid sector supplied to 'dmsetup message'.
Free any previously-set string if a dm_task_set_* function is called again.
Do not allow passing empty new name for dmsetup rename.
9 years, 6 months
master - udev: remove unused line in 69-dm-lvm-metad.rules
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f393a5c15631f8...
Commit: f393a5c15631f883883df41e85b3209b33005cd6
Parent: 2c41c8b88610bff6a3352b93f6b5c70a3744c817
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Sep 20 09:42:27 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Sep 20 09:45:34 2013 +0200
udev: remove unused line in 69-dm-lvm-metad.rules
The explicit check for *_raid_member is not actually needed as
this gets filtered out by the ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member" rule.
---
udev/69-dm-lvm-metad.rules.in | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
index 6363a79..ba43396 100644
--- a/udev/69-dm-lvm-metad.rules.in
+++ b/udev/69-dm-lvm-metad.rules.in
@@ -27,6 +27,7 @@ ENV{LVM_PV_GONE}=="1", GOTO="lvm_scan"
# Only process devices already marked as a PV - this requires blkid to be called before.
ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member", GOTO="lvm_end"
+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
# Inform lvmetad about any PV that is gone.
ACTION=="remove", GOTO="lvm_scan"
@@ -76,11 +77,6 @@ LABEL="lvm_scan"
# MD | | X | X* | |
# loop | | X | X* | |
# other | X | | X | | X
-
-# Skip device that is a multipath or RAID component
-ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
-ENV{ID_FS_TYPE}=="*_raid_member", GOTO="lvm_end"
-
RUN+="(LVM_EXEC)/lvm pvscan --background --cache --activate ay --major $major --minor $minor", ENV{LVM_SCANNED}="1"
LABEL="lvm_end"
9 years, 6 months
master - RAID: Don't allow syncaction changes on non-RAID LVs
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2c41c8b88610bf...
Commit: 2c41c8b88610bff6a3352b93f6b5c70a3744c817
Parent: 25bed9968155f43ef0b8832383ef711e7ae1685d
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Thu Sep 19 22:33:01 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Thu Sep 19 22:33:01 2013 -0500
RAID: Don't allow syncaction changes on non-RAID LVs
Don't allow syncaction or other RAID-type messages on non-RAID
logical volumes.
---
lib/activate/activate.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index e5033c6..7b535c6 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -896,6 +896,12 @@ int lv_raid_message(const struct logical_volume *lv, const char *msg)
struct dev_manager *dm;
struct dm_status_raid *status;
+ if (!seg_is_raid(first_seg(lv))) {
+ log_error("%s/%s must be a RAID logical volume to"
+ " perform this action.", lv->vg->name, lv->name);
+ return 0;
+ }
+
if (!lv_is_active_locally(lv)) {
log_error("Unable to send message to an inactive logical volume.");
return 0;
9 years, 6 months
master - clvmd: Avoid a 3-way deadlock in dead-client cleanup.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=25bed9968155f4...
Commit: 25bed9968155f43ef0b8832383ef711e7ae1685d
Parent: 3df50d822b8064c5536968556c466c50a9a3ace5
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Sep 9 00:01:44 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Sep 18 21:17:48 2013 +0200
clvmd: Avoid a 3-way deadlock in dead-client cleanup.
---
daemons/clvmd/clvmd.c | 177 ++++++++++++++++++++++++++-----------------------
daemons/clvmd/clvmd.h | 1 +
2 files changed, 96 insertions(+), 82 deletions(-)
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index a52b39d..bed8e68 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -119,6 +119,7 @@ static void *pre_and_post_thread(void *arg);
static int send_message(void *buf, int msglen, const char *csid, int fd,
const char *errtext);
static int read_from_local_sock(struct local_client *thisfd);
+static int cleanup_zombie(struct local_client *thisfd);
static int process_local_command(struct clvm_header *msg, int msglen,
struct local_client *client,
unsigned short xid);
@@ -698,6 +699,7 @@ static int local_rendezvous_callback(struct local_client *thisfd, char *buf,
newfd->bits.localsock.sent_out = FALSE;
newfd->bits.localsock.threadid = 0;
newfd->bits.localsock.finished = 0;
+ newfd->bits.localsock.cleanup_needed = 0;
newfd->bits.localsock.pipe_client = NULL;
newfd->bits.localsock.private = NULL;
newfd->bits.localsock.all_success = 1;
@@ -889,7 +891,7 @@ static void main_loop(int local_sock, int cmd_timeout)
for (thisfd = &local_client_head; thisfd != NULL;
thisfd = thisfd->next) {
- if (thisfd->removeme) {
+ if (thisfd->removeme && !cleanup_zombie(thisfd)) {
struct local_client *free_fd;
lastfd->next = thisfd->next;
free_fd = thisfd;
@@ -916,7 +918,6 @@ static void main_loop(int local_sock, int cmd_timeout)
/* Got error or EOF: Remove it from the list safely */
if (ret <= 0) {
- struct local_client *free_fd;
int type = thisfd->type;
/* If the cluster socket shuts down, so do we */
@@ -926,12 +927,7 @@ static void main_loop(int local_sock, int cmd_timeout)
DEBUGLOG("ret == %d, errno = %d. removing client\n",
ret, errno);
- lastfd->next = thisfd->next;
- free_fd = thisfd;
- safe_close(&(free_fd->fd));
-
- /* Queue cleanup, this also frees the client struct */
- add_to_lvmqueue(free_fd, NULL, 0, NULL);
+ thisfd->removeme = 1;
break;
}
@@ -1174,6 +1170,95 @@ static void dump_message(char *buf, int len)
}
}
+static int cleanup_zombie(struct local_client *thisfd)
+{
+ int *status;
+
+ if (thisfd->type != LOCAL_SOCK)
+ return 0;
+
+ if (!thisfd->bits.localsock.cleanup_needed)
+ return 0;
+
+ DEBUGLOG("EOF on local socket: inprogress=%d\n",
+ thisfd->bits.localsock.in_progress);
+
+ thisfd->bits.localsock.finished = 1;
+
+ /* If the client went away in mid command then tidy up */
+ if (thisfd->bits.localsock.in_progress) {
+ pthread_kill(thisfd->bits.localsock.threadid, SIGUSR2);
+ if (pthread_mutex_trylock(&thisfd->bits.localsock.mutex))
+ goto bail;
+ thisfd->bits.localsock.state = POST_COMMAND;
+ pthread_cond_signal(&thisfd->bits.localsock.cond);
+ pthread_mutex_unlock(&thisfd->bits.localsock.mutex);
+
+ /* Free any unsent buffers */
+ free_reply(thisfd);
+ }
+
+ /* Kill the subthread & free resources */
+ if (thisfd->bits.localsock.threadid) {
+ DEBUGLOG("Waiting for child thread\n");
+ pthread_mutex_lock(&thisfd->bits.localsock.mutex);
+ thisfd->bits.localsock.state = PRE_COMMAND;
+ pthread_cond_signal(&thisfd->bits.localsock.cond);
+ pthread_mutex_unlock(&thisfd->bits.localsock.mutex);
+
+ if ((errno = pthread_join(thisfd->bits.localsock.threadid,
+ (void **) &status)))
+ log_sys_error("pthread_join", "");
+
+ DEBUGLOG("Joined child thread\n");
+
+ thisfd->bits.localsock.threadid = 0;
+ pthread_cond_destroy(&thisfd->bits.localsock.cond);
+ pthread_mutex_destroy(&thisfd->bits.localsock.mutex);
+
+ /* Remove the pipe client */
+ if (thisfd->bits.localsock.pipe_client != NULL) {
+ struct local_client *newfd;
+ struct local_client *lastfd = NULL;
+ struct local_client *free_fd = NULL;
+
+ (void) close(thisfd->bits.localsock.pipe_client->fd); /* Close pipe */
+ (void) close(thisfd->bits.localsock.pipe);
+
+ /* Remove pipe client */
+ for (newfd = &local_client_head; newfd != NULL;
+ newfd = newfd->next) {
+ if (thisfd->bits.localsock.
+ pipe_client == newfd) {
+ thisfd->bits.localsock.
+ pipe_client = NULL;
+
+ lastfd->next = newfd->next;
+ free_fd = newfd;
+ newfd->next = lastfd;
+ free(free_fd);
+ break;
+ }
+ lastfd = newfd;
+ }
+ }
+ }
+
+ /* Free the command buffer */
+ free(thisfd->bits.localsock.cmd);
+
+ /* Clear out the cross-link */
+ if (thisfd->bits.localsock.pipe_client != NULL)
+ thisfd->bits.localsock.pipe_client->bits.pipe.client =
+ NULL;
+
+ safe_close(&(thisfd->fd));
+ thisfd->bits.localsock.cleanup_needed = 0;
+ return 0;
+bail:
+ return 1;
+}
+
/* Called when we have a read from the local socket.
was in the main loop but it's grown up and is a big girl now */
static int read_from_local_sock(struct local_client *thisfd)
@@ -1204,80 +1289,8 @@ static int read_from_local_sock(struct local_client *thisfd)
/* EOF or error on socket */
if (len <= 0) {
- int *status;
-
- DEBUGLOG("EOF on local socket: inprogress=%d\n",
- thisfd->bits.localsock.in_progress);
-
- thisfd->bits.localsock.finished = 1;
-
- /* If the client went away in mid command then tidy up */
- if (thisfd->bits.localsock.in_progress) {
- pthread_kill(thisfd->bits.localsock.threadid, SIGUSR2);
- pthread_mutex_lock(&thisfd->bits.localsock.mutex);
- thisfd->bits.localsock.state = POST_COMMAND;
- pthread_cond_signal(&thisfd->bits.localsock.cond);
- pthread_mutex_unlock(&thisfd->bits.localsock.mutex);
-
- /* Free any unsent buffers */
- free_reply(thisfd);
- }
-
- /* Kill the subthread & free resources */
- if (thisfd->bits.localsock.threadid) {
- DEBUGLOG("Waiting for child thread\n");
- pthread_mutex_lock(&thisfd->bits.localsock.mutex);
- thisfd->bits.localsock.state = PRE_COMMAND;
- pthread_cond_signal(&thisfd->bits.localsock.cond);
- pthread_mutex_unlock(&thisfd->bits.localsock.mutex);
-
- if ((errno = pthread_join(thisfd->bits.localsock.threadid,
- (void **) &status)))
- log_sys_error("pthread_join", "");
-
- DEBUGLOG("Joined child thread\n");
-
- thisfd->bits.localsock.threadid = 0;
- pthread_cond_destroy(&thisfd->bits.localsock.cond);
- pthread_mutex_destroy(&thisfd->bits.localsock.mutex);
-
- /* Remove the pipe client */
- if (thisfd->bits.localsock.pipe_client != NULL) {
- struct local_client *newfd;
- struct local_client *lastfd = NULL;
- struct local_client *free_fd = NULL;
-
- (void) close(thisfd->bits.localsock.pipe_client->fd); /* Close pipe */
- (void) close(thisfd->bits.localsock.pipe);
-
- /* Remove pipe client */
- for (newfd = &local_client_head; newfd != NULL;
- newfd = newfd->next) {
- if (thisfd->bits.localsock.
- pipe_client == newfd) {
- thisfd->bits.localsock.
- pipe_client = NULL;
-
- lastfd->next = newfd->next;
- free_fd = newfd;
- newfd->next = lastfd;
- free(free_fd);
- break;
- }
- lastfd = newfd;
- }
- }
- }
-
- /* Free the command buffer */
- free(thisfd->bits.localsock.cmd);
-
- /* Clear out the cross-link */
- if (thisfd->bits.localsock.pipe_client != NULL)
- thisfd->bits.localsock.pipe_client->bits.pipe.client =
- NULL;
-
- safe_close(&(thisfd->fd));
+ thisfd->bits.localsock.cleanup_needed = 1;
+ cleanup_zombie(thisfd); /* we ignore errors here */
return 0;
} else {
int comms_pipe[2];
diff --git a/daemons/clvmd/clvmd.h b/daemons/clvmd/clvmd.h
index fb0589d..0f837dd 100644
--- a/daemons/clvmd/clvmd.h
+++ b/daemons/clvmd/clvmd.h
@@ -53,6 +53,7 @@ struct localsock_bits {
int finished; /* Flag to tell subthread to exit */
int all_success; /* Set to 0 if any node (or the pre_command)
failed */
+ int cleanup_needed; /* helper for cleanup_zombie */
struct local_client *pipe_client;
pthread_t threadid;
enum { PRE_COMMAND, POST_COMMAND, QUIT } state;
9 years, 6 months
master - vgconvert: Do not call lvmetad_vg_remove (path shared with vgcfgbackup).
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3df50d822b8064...
Commit: 3df50d822b8064c5536968556c466c50a9a3ace5
Parent: 054cf25b5f6a34de8886ba6293deee2b24720902
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Sep 18 12:53:11 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Sep 18 12:53:11 2013 +0200
vgconvert: Do not call lvmetad_vg_remove (path shared with vgcfgbackup).
---
lib/format_text/archiver.c | 6 +++---
lib/format_text/archiver.h | 2 +-
tools/vgconvert.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c
index 752e93c..e3e7777 100644
--- a/lib/format_text/archiver.c
+++ b/lib/format_text/archiver.c
@@ -308,7 +308,7 @@ struct volume_group *backup_read_vg(struct cmd_context *cmd,
}
/* ORPHAN and VG locks held before calling this */
-int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
+int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg, int drop_lvmetad)
{
struct pv_list *pvl;
struct format_instance *fid;
@@ -351,7 +351,7 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
if (!vg_write(vg))
return_0;
- if (lvmetad_active()) {
+ if (drop_lvmetad && lvmetad_active()) {
struct volume_group *vg_lvmetad = lvmetad_vg_lookup(cmd, vg->name, NULL);
if (vg_lvmetad) {
lvmetad_vg_remove(vg_lvmetad);
@@ -397,7 +397,7 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
missing_pvs = vg_missing_pv_count(vg);
if (missing_pvs == 0)
- r = backup_restore_vg(cmd, vg);
+ r = backup_restore_vg(cmd, vg, 1);
else
log_error("Cannot restore Volume Group %s with %i PVs "
"marked as missing.", vg->name, missing_pvs);
diff --git a/lib/format_text/archiver.h b/lib/format_text/archiver.h
index ddff687..bc756d5 100644
--- a/lib/format_text/archiver.h
+++ b/lib/format_text/archiver.h
@@ -51,7 +51,7 @@ int backup_remove(struct cmd_context *cmd, const char *vg_name);
struct volume_group *backup_read_vg(struct cmd_context *cmd,
const char *vg_name, const char *file);
-int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg);
+int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg, int drop_lvmetad);
int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
const char *file, int force);
int backup_restore(struct cmd_context *cmd, const char *vg_name, int force);
diff --git a/tools/vgconvert.c b/tools/vgconvert.c
index fbb1b4e..86e3097 100644
--- a/tools/vgconvert.c
+++ b/tools/vgconvert.c
@@ -184,7 +184,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
log_verbose("Writing metadata for VG %s using format %s", vg_name,
cmd->fmt->name);
- if (!backup_restore_vg(cmd, vg)) {
+ if (!backup_restore_vg(cmd, vg, 0)) {
log_error("Conversion failed for volume group %s.", vg_name);
log_error("Use pvcreate and vgcfgrestore to repair from "
"archived metadata.");
9 years, 6 months
master - vgcfgrestore: Remove VG rom lvmetad later, to better deal with errors.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=054cf25b5f6a34...
Commit: 054cf25b5f6a34de8886ba6293deee2b24720902
Parent: a6af611ae127de202be9e172099c6efe9ed41d7e
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Sep 18 11:22:49 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Sep 18 11:24:58 2013 +0200
vgcfgrestore: Remove VG rom lvmetad later, to better deal with errors.
---
lib/format_text/archiver.c | 14 +++++++++++++-
tools/vgcfgrestore.c | 8 --------
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c
index b6b9fb3..752e93c 100644
--- a/lib/format_text/archiver.c
+++ b/lib/format_text/archiver.c
@@ -18,6 +18,7 @@
#include "format-text.h"
#include "lvm-string.h"
#include "lvmcache.h"
+#include "lvmetad.h"
#include "toolcontext.h"
#include "locking.h"
@@ -347,7 +348,18 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
vg->extent_size = tmp;
}
- if (!vg_write(vg) || !vg_commit(vg))
+ if (!vg_write(vg))
+ return_0;
+
+ if (lvmetad_active()) {
+ struct volume_group *vg_lvmetad = lvmetad_vg_lookup(cmd, vg->name, NULL);
+ if (vg_lvmetad) {
+ lvmetad_vg_remove(vg_lvmetad);
+ release_vg(vg_lvmetad);
+ }
+ }
+
+ if (!vg_commit(vg))
return_0;
return 1;
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index f560836..36396c3 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -57,14 +57,6 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
- if (lvmetad_active()) {
- struct volume_group *vg = lvmetad_vg_lookup(cmd, vg_name, NULL);
- if (vg) {
- lvmetad_vg_remove(vg);
- release_vg(vg);
- }
- }
-
cmd->handles_unknown_segments = 1;
if (!(arg_count(cmd, file_ARG) ?
9 years, 6 months
master - vgcfgrestore: Remove the VG from lvmetad before overwriting it.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a6af611ae127de...
Commit: a6af611ae127de202be9e172099c6efe9ed41d7e
Parent: c2dd0a832a8f06471f86e8244884c4dc902cc9f7
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Sep 18 10:34:38 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Sep 18 10:37:29 2013 +0200
vgcfgrestore: Remove the VG from lvmetad before overwriting it.
---
tools/vgcfgrestore.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index 36396c3..f560836 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -57,6 +57,14 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
+ if (lvmetad_active()) {
+ struct volume_group *vg = lvmetad_vg_lookup(cmd, vg_name, NULL);
+ if (vg) {
+ lvmetad_vg_remove(vg);
+ release_vg(vg);
+ }
+ }
+
cmd->handles_unknown_segments = 1;
if (!(arg_count(cmd, file_ARG) ?
9 years, 6 months
master - man: lvs man page was not accurate on the volume health bit of lv_attr
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c2dd0a832a8f06...
Commit: c2dd0a832a8f06471f86e8244884c4dc902cc9f7
Parent: 68f841fcda29ee0af177b0299b52842afcf1bae2
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Tue Sep 17 23:03:57 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Tue Sep 17 23:03:57 2013 -0500
man: lvs man page was not accurate on the volume health bit of lv_attr
The 'm'ismatches flag only shows after a "check" scrubbing operation -
not after a "check" or "repair" as indicated by the man page.
---
man/lvs.8.in | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/man/lvs.8.in b/man/lvs.8.in
index 8f97dc2..32cb788 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -173,12 +173,11 @@ more of the Physical Volumes this RAID Logical Volume uses had suffered a
write error. The write error could be due to a temporary failure of that
Physical Volume or an indication that it is failing. The device should be
refreshed or replaced. (m)ismatches signifies that the RAID logical volume
-has portions of the array that are not coherent or that the array has
-recently repaired inconsistencies. An additional "check" after a "repair"
-of a RAID logical volume will clear this flag if no additional discrepancies
-are found. ("check" and "repair" of a RAID Logical Volume can be done via
-the 'lvchange' command.) (w)ritemostly signifies the devices in a RAID 1
-logical volume that have been marked write-mostly.
+has portions of the array that are not coherent. Inconsistencies are
+detected by initiating a "check" on a RAID logical volume. (The scrubbing
+operations, "check" and "repair", can be performed on a RAID logical
+volume via the 'lvchange' command.) (w)ritemostly signifies the devices in
+a RAID 1 logical volume that have been marked write-mostly.
.IP 10 3
s(k)ip activation: this volume is flagged to be skipped during activation.
.RE
9 years, 6 months