master - lvremove: remove thin volumes on damaged pools
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=93a80018ae8e2f...
Commit: 93a80018ae8e2f3f56e56b42237779661c9040b3
Parent: 0b872ce870b753d034da919814c13703606af188
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jul 2 00:13:32 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jul 2 10:37:52 2014 +0200
lvremove: remove thin volumes on damaged pools
Support remove of thin volumes With --force --force
when thin pools is damaged.
This way it's possible to remove thin pool with
unrepairable metadata without requiring to
manually edit lvm2 metadata.
lvremove -ff vg/pool
removes all thin volumes and pool even when
thin pool cannot be activated (to accept
removal of thin volumes in kernel metadata)
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 846983f..230bdf0 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.108 -
=================================
+ Support lvremove -ff to remove thin volumes from broken thin pools.
Require --yes to skip raid repair prompt.
Change makefile %.d generation to handle filename changes without make clean.
Fix use of buildir in make pofile.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index d35a244..537ec30 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4923,8 +4923,13 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
/* Clear thin pool stacked messages */
if (pool_lv && !pool_has_message(first_seg(pool_lv), lv, 0) &&
!update_pool_lv(pool_lv, 1)) {
- log_error("Failed to update thin pool %s.", pool_lv->name);
- return 0;
+ if (force < DONT_PROMPT_OVERRIDE) {
+ log_error("Failed to update thin pool %s.", pool_lv->name);
+ return 0;
+ }
+ log_warn("WARNING: Forced to ignoring failure of pool metadata update %s.",
+ pool_lv->name);
+ pool_lv = NULL; /* Do not retry */
}
visible = lv_is_visible(lv);
9 years, 8 months
master - raid: don't skip prompt with force
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0b872ce870b753...
Commit: 0b872ce870b753d034da919814c13703606af188
Parent: c460f35cdadc853fc5bb7b796dbc0ead6968b82c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jul 1 09:55:04 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jul 2 10:36:32 2014 +0200
raid: don't skip prompt with force
Yes is meant to be used to skip all new prompts.
(--force just adds more prompts).
---
WHATS_NEW | 1 +
tools/lvconvert.c | 22 +++++++---------------
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2259976..846983f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.108 -
=================================
+ Require --yes to skip raid repair prompt.
Change makefile %.d generation to handle filename changes without make clean.
Fix use of buildir in make pofile.
Enhance private volumes UUIDs with suffixed for easier detection.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 3e00e17..d80fa60 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1797,12 +1797,11 @@ static int _is_valid_raid_conversion(const struct segment_type *from_segtype,
return 1;
}
-static void _lvconvert_raid_repair_ask(struct cmd_context *cmd, int *replace_dev)
+static void _lvconvert_raid_repair_ask(struct cmd_context *cmd,
+ struct lvconvert_params *lp,
+ int *replace_dev)
{
- const char *dev_policy = NULL;
-
- int force = arg_count(cmd, force_ARG);
- int yes = arg_count(cmd, yes_ARG);
+ const char *dev_policy;
*replace_dev = 1;
@@ -1818,15 +1817,8 @@ static void _lvconvert_raid_repair_ask(struct cmd_context *cmd, int *replace_dev
return;
}
- if (force != PROMPT) {
- *replace_dev = 0;
- return;
- }
-
- if (yes)
- return;
-
- if (yes_no_prompt("Attempt to replace failed RAID images "
+ if (!lp->yes &&
+ yes_no_prompt("Attempt to replace failed RAID images "
"(requires full device resync)? [y/n]: ") == 'n') {
*replace_dev = 0;
}
@@ -1926,7 +1918,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
init_mirror_in_sync(1);
}
- _lvconvert_raid_repair_ask(cmd, &replace);
+ _lvconvert_raid_repair_ask(cmd, lp, &replace);
if (replace) {
if (!(failed_pvs = _failed_pv_list(lv->vg)))
9 years, 8 months
master - raid: switch to log_warn
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c460f35cdadc85...
Commit: c460f35cdadc853fc5bb7b796dbc0ead6968b82c
Parent: 355258be58fe52df0e90cb3831bc0e09f06d2e2a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jul 1 09:53:58 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jul 2 10:34:40 2014 +0200
raid: switch to log_warn
Use log_warn for warning message.
log_error is printed when command returns error code.
---
tools/lvconvert.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 28cbb32..3e00e17 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1914,10 +1914,9 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
}
if (sync_percent != DM_PERCENT_100) {
- log_error("WARNING: %s/%s is not in-sync.",
- lv->vg->name, lv->name);
- log_error("WARNING: Portions of the array may"
- " be unrecoverable.");
+ log_warn("WARNING: %s/%s is not in-sync.",
+ lv->vg->name, lv->name);
+ log_warn("WARNING: Portions of the array may be unrecoverable.");
/*
* The kernel will not allow a device to be replaced
9 years, 8 months
master - mirror: mirror_or_raid_type_requested update
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=355258be58fe52...
Commit: 355258be58fe52df0e90cb3831bc0e09f06d2e2a
Parent: c77197c688fad937b0701d749b9a449160bb40dc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jul 1 10:13:10 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jul 2 10:34:39 2014 +0200
mirror: mirror_or_raid_type_requested update
mirror_or_raid_type_requested really checks for mirror type.
Convert macros mirror_or_raid_type_requested() and
snapshot_type_requested() into inline functions.
---
tools/lvconvert.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index d0555b3..28cbb32 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -211,11 +211,13 @@ static int _check_conversion_type(struct cmd_context *cmd, const char *type_str)
}
/* -s/--snapshot and --type snapshot are synonyms */
-#define snapshot_type_requested(cmd,type_str) (arg_count(cmd, snapshot_ARG) || \
- !strcmp(type_str, "snapshot"))
+static inline int snapshot_type_requested(struct cmd_context *cmd, const char *type_str) {
+ return (arg_count(cmd, snapshot_ARG) || !strcmp(type_str, "snapshot"));
+}
/* mirror/raid* (1,10,4,5,6 and their variants) reshape */
-#define mirror_or_raid_type_requested(cmd,type_str) (arg_count(cmd, mirrors_ARG) || \
- !strncmp(type_str, "raid", 4))
+static inline int mirror_or_raid_type_requested(struct cmd_context *cmd, const char *type_str) {
+ return (arg_count(cmd, mirrors_ARG) || !strncmp(type_str, "raid", 4) || !strcmp(type_str, "mirror"));
+}
static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
int argc, char **argv)
9 years, 8 months
master - make: Fix pofile and .d file generation.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c77197c688fad9...
Commit: c77197c688fad937b0701d749b9a449160bb40dc
Parent: 70551eec5921e3b8bce7318880e54836f467b5fa
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jul 2 00:48:50 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jul 2 00:48:50 2014 +0100
make: Fix pofile and .d file generation.
Use builddir not srcdir with make pofile.
Append 'incfile:' lines to %.d files to handle newly-missing dependencies
without 'make clean' after a file is moved or deleted.
---
WHATS_NEW | 2 ++
make.tmpl.in | 4 +++-
po/Makefile.in | 6 +++---
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4fa881c..2259976 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.108 -
=================================
+ Change makefile %.d generation to handle filename changes without make clean.
+ Fix use of buildir in make pofile.
Enhance private volumes UUIDs with suffixed for easier detection.
Do not use reserved _[tc]meta volumes for temporary LVs.
Leave backup pool metadata with _meta%d suffix instead of reserved _tmeta%d.
diff --git a/make.tmpl.in b/make.tmpl.in
index 5a3694a..5d4c144 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -362,7 +362,7 @@ $(TARGETS): $(OBJECTS)
$(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
%.pot: %.c Makefile
- $(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
+ $(CC) -E $(INCLUDES) -include $(top_builddir)/include/pogen.h \
$(DEFS) $(WFLAGS) $(CFLAGS) $< > $@
%.so: %.o
@@ -413,6 +413,8 @@ $(LIB_STATIC): $(OBJECTS)
DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
$(CC) -MM $(INCLUDES) $(DEFS) -o $@ $<; \
sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \
+ DEPLIST=`sed 's/ \\\\//;s/.*://;' < $@`; \
+ echo $$DEPLIST | fmt -1 | sed 's/ //g;s/\(.*\)/\1:/' >> $@; \
[ -s $@ ] || $(RM) $@
%.mo: %.po
diff --git a/po/Makefile.in b/po/Makefile.in
index a4f57a6..ff5db17 100644
--- a/po/Makefile.in
+++ b/po/Makefile.in
@@ -19,10 +19,10 @@ LANGS=de
TARGETS=$(LANGS:%=lvm2_%.mo) $(LANGS:%=dm_%.mo)
-DM_POSOURCES = $(top_srcdir)/dmsetup/*.pot $(top_srcdir)/libdm/*.pot \
- $(top_srcdir)/libdm/*/*.pot
+DM_POSOURCES = $(top_builddir)/tools/dmsetup.pot $(top_builddir)/libdm/*.pot \
+ $(top_builddir)/libdm/*/*.pot
-LVM_POSOURCES = $(top_srcdir)/tools/*.pot $(top_srcdir)/lib/*/*.pot
+LVM_POSOURCES = $(top_builddir)/tools/*.pot $(top_builddir)/lib/*/*.pot
include $(top_builddir)/make.tmpl
9 years, 8 months