master - release 2.02.103
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=04d9a526843dcb...
Commit: 04d9a526843dcb93fc0110e6e9dfbb12143a3930
Parent: 0d03503a453f91cee09fb3a1664d2136d58ac751
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Oct 4 14:32:23 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Oct 4 14:32:23 2013 +0100
release 2.02.103
52 files changed, 598 insertions(+), 264 deletions(-)
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 12 +++++++-----
WHATS_NEW_DM | 4 ++--
conf/example.conf.in | 2 +-
conf/thin-performance.profile | 2 +-
lib/config/defaults.h | 6 +++---
lib/metadata/lv_manip.c | 4 ++--
lib/metadata/metadata-exported.h | 2 +-
lib/metadata/thin_manip.c | 2 +-
tools/lvconvert.c | 8 ++++----
tools/lvcreate.c | 4 ++--
12 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/VERSION b/VERSION
index d1e7c0e..f4bbdb9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.103(2)-git (2013-09-23)
+2.02.103(2)-git (2013-10-04)
diff --git a/VERSION_DM b/VERSION_DM
index 6c755b8..f4e8c0b 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.82-git (2013-09-23)
+1.02.82-git (2013-10-04)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0b71786..d69e74e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,14 +1,16 @@
-Version 2.02.103 -
-======================================
+Version 2.02.103 - 4th October 2013
+===================================
+ Ensure vgid matches before removing vgname entry from lvmetad cache.
Add --ignoreskippedcluster for exit status success when clustered VGs skipped.
- Fix 3min udev timeout so that it is applied for all LVM volumes.
+ Fix 3 minute udev timeout so that it is applied for all LVM volumes.
+ Fix thin/raid & activation config defaults with configure --disable-devmapper.
Fix RAID calculation for sufficient allocatable space.
- Conversion from linear to mirror or RAID1 now honors mirror_segtype_default.
+ lvconvert from linear to mirror or RAID1 now honors mirror_segtype_default.
Add thin-performance configuration profile.
Add lvm.conf allocation/thin_pool_chunk_size_policy option.
Fix contiguous & cling allocation policies for parity RAID. (2.02.100)
Have lvmconf --enable/disable-cluster reset/set use_lvmetad.
- Don't install separate command symlink in binary directory for 'lvm devtypes'.
+ Don't install separate command symlink for 'lvm devtypes'. (2.02.101)
Add seg_size_pe field to reports.
Support start+length notation with command line PE ranges.
Exit cleanly with message when pvmove cannot restart because LV is inactive.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index dfc2d89..9dfd9bf 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.82 -
-=====================================
+Version 1.02.82 - 4th October 2013
+==================================
Define symbolic names for subsystem udev flags in libdevmapper for easier use.
Make subsystem udev rules responsible for importing DM_SUBSYSTEM_UDEV_FLAG*.
diff --git a/conf/example.conf.in b/conf/example.conf.in
index e0f8be8..ae571b6 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -255,7 +255,7 @@ allocation {
# Specify chunk size calculation policy for thin pool volumes.
# Possible options are:
# "generic" - if thin_pool_chunk_size is defined, use it.
- # Otherwise, calcucate the chunk size based on
+ # Otherwise, calculate the chunk size based on
# estimation and device hints exposed in sysfs:
# the minimum_io_size. The chunk size is always
# at least 64KiB.
diff --git a/conf/thin-performance.profile b/conf/thin-performance.profile
index fbd46aa..2914de2 100644
--- a/conf/thin-performance.profile
+++ b/conf/thin-performance.profile
@@ -1,4 +1,4 @@
allocation {
- thin_pool_chunk_size_calculation = "performance"
+ thin_pool_chunk_size_policy = "performance"
thin_pool_zero = 0
}
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index fc2d4dc..bd7a40a 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -141,9 +141,9 @@
# define DEFAULT_ACTIVATION 0
#endif
-# define DEFAULT_RESERVED_MEMORY 8192
-# define DEFAULT_RESERVED_STACK 64 /* KB */
-# define DEFAULT_PROCESS_PRIORITY -18
+#define DEFAULT_RESERVED_MEMORY 8192
+#define DEFAULT_RESERVED_STACK 64 /* KB */
+#define DEFAULT_PROCESS_PRIORITY -18
#define DEFAULT_AUTO_SET_ACTIVATION_SKIP 1
#define DEFAULT_USE_LINEAR_TARGET 1
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 71b5278..f42db1d 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5541,7 +5541,7 @@ static int _recalculate_thin_pool_chunk_size_with_dev_hints(struct lvcreate_para
struct cmd_context *cmd = pool_lv->vg->cmd;
unsigned long previous_hint = 0, hint = 0;
uint32_t chunk_size = lp->chunk_size;
- uint32_t default_chunk_size = lp->thin_chunk_size_calc_method == THIN_CHUNK_SIZE_CALC_METHOD_PERFORMANCE ?
+ uint32_t default_chunk_size = lp->thin_chunk_size_calc_policy == THIN_CHUNK_SIZE_CALC_METHOD_PERFORMANCE ?
DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE*2 : DEFAULT_THIN_POOL_CHUNK_SIZE*2;
if (lp->passed_args & PASS_ARG_CHUNK_SIZE ||
@@ -5552,7 +5552,7 @@ static int _recalculate_thin_pool_chunk_size_with_dev_hints(struct lvcreate_para
dm_list_iterate_items(seg, &pool_data_lv->segments) {
pv = seg_pv(seg, 0);
- if (lp->thin_chunk_size_calc_method == THIN_CHUNK_SIZE_CALC_METHOD_PERFORMANCE)
+ if (lp->thin_chunk_size_calc_policy == THIN_CHUNK_SIZE_CALC_METHOD_PERFORMANCE)
hint = dev_optimal_io_size(cmd->dev_types, pv_dev(pv));
else
hint = dev_minimum_io_size(cmd->dev_types, pv_dev(pv));
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 971f677..308dcfe 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -728,7 +728,7 @@ struct lvcreate_params {
thin_discards_t discards; /* thin */
#define THIN_CHUNK_SIZE_CALC_METHOD_GENERIC 0x01
#define THIN_CHUNK_SIZE_CALC_METHOD_PERFORMANCE 0x02
- int thin_chunk_size_calc_method;
+ int thin_chunk_size_calc_policy;
const char *origin; /* snap */
const char *pool; /* thin */
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index f85696c..a6e0fc2 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -582,7 +582,7 @@ static int _get_pool_chunk_size_calc(const char *str,
*chunk_size = DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE * 2;
}
else {
- log_error("Thin pool chunk size calculation method \"%s\" is unknown.", str);
+ log_error("Thin pool chunk size calculation policy \"%s\" is unrecognised.", str);
return 0;
}
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index ebb5138..49881fa 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -34,7 +34,7 @@ struct lvconvert_params {
int wait_completion;
int need_polling;
- int thin_chunk_size_calc_method;
+ int thin_chunk_size_calc_policy;
uint32_t chunk_size;
uint32_t region_size;
@@ -2329,7 +2329,7 @@ static int _lvconvert_thinpool(struct cmd_context *cmd,
if (!lp->pool_metadata_lv_name) {
if (!update_pool_params(pool_lv->vg, lp->target_attr, lp->passed_args,
pool_lv->le_count, pool_lv->vg->extent_size,
- &lp->thin_chunk_size_calc_method, &lp->chunk_size,
+ &lp->thin_chunk_size_calc_policy, &lp->chunk_size,
&lp->discards, &lp->poolmetadata_size, &lp->zero))
return_0;
@@ -2441,7 +2441,7 @@ static int _lvconvert_thinpool(struct cmd_context *cmd,
}
if (!update_pool_params(pool_lv->vg, lp->target_attr, lp->passed_args,
pool_lv->le_count, pool_lv->vg->extent_size,
- &lp->thin_chunk_size_calc_method, &lp->chunk_size,
+ &lp->thin_chunk_size_calc_policy, &lp->chunk_size,
&lp->discards, &lp->poolmetadata_size, &lp->zero))
return_0;
}
@@ -2723,7 +2723,7 @@ static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp
if (arg_count(cmd, thinpool_ARG) &&
!get_pool_params(cmd, lv_config_profile(lv),
- &lp->passed_args, &lp->thin_chunk_size_calc_method,
+ &lp->passed_args, &lp->thin_chunk_size_calc_policy,
&lp->chunk_size, &lp->discards,
&lp->poolmetadata_size, &lp->zero))
goto_bad;
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index c5a2e20..4850872 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -336,7 +336,7 @@ static int _update_extents_params(struct volume_group *vg,
if (lp->create_thin_pool) {
if (!update_pool_params(vg, lp->target_attr, lp->passed_args,
lp->extents, vg->extent_size,
- &lp->thin_chunk_size_calc_method,
+ &lp->thin_chunk_size_calc_policy,
&lp->chunk_size, &lp->discards,
&lp->poolmetadatasize, &lp->zero))
return_0;
@@ -877,7 +877,7 @@ static int _lvcreate_params(struct lvcreate_params *lp,
!get_stripe_params(cmd, &lp->stripes, &lp->stripe_size) ||
(lp->create_thin_pool &&
!get_pool_params(cmd, NULL, &lp->passed_args,
- &lp->thin_chunk_size_calc_method,
+ &lp->thin_chunk_size_calc_policy,
&lp->chunk_size, &lp->discards,
&lp->poolmetadatasize, &lp->zero)) ||
!_read_mirror_params(lp, cmd) ||
10 years, 7 months
master - release 2.02.103
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6d1898d16cb21a...
Commit: 6d1898d16cb21a7e3a1629b1229ab267c04d7c77
Parent: 0d03503a453f91cee09fb3a1664d2136d58ac751
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Oct 4 14:17:30 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Oct 4 14:17:30 2013 +0100
release 2.02.103
52 files changed, 598 insertions(+), 264 deletions(-)
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 12 +++++++-----
WHATS_NEW_DM | 4 ++--
conf/example.conf.in | 2 +-
lib/config/defaults.h | 6 +++---
6 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/VERSION b/VERSION
index d1e7c0e..f4bbdb9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.103(2)-git (2013-09-23)
+2.02.103(2)-git (2013-10-04)
diff --git a/VERSION_DM b/VERSION_DM
index 6c755b8..f4e8c0b 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.82-git (2013-09-23)
+1.02.82-git (2013-10-04)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0b71786..d69e74e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,14 +1,16 @@
-Version 2.02.103 -
-======================================
+Version 2.02.103 - 4th October 2013
+===================================
+ Ensure vgid matches before removing vgname entry from lvmetad cache.
Add --ignoreskippedcluster for exit status success when clustered VGs skipped.
- Fix 3min udev timeout so that it is applied for all LVM volumes.
+ Fix 3 minute udev timeout so that it is applied for all LVM volumes.
+ Fix thin/raid & activation config defaults with configure --disable-devmapper.
Fix RAID calculation for sufficient allocatable space.
- Conversion from linear to mirror or RAID1 now honors mirror_segtype_default.
+ lvconvert from linear to mirror or RAID1 now honors mirror_segtype_default.
Add thin-performance configuration profile.
Add lvm.conf allocation/thin_pool_chunk_size_policy option.
Fix contiguous & cling allocation policies for parity RAID. (2.02.100)
Have lvmconf --enable/disable-cluster reset/set use_lvmetad.
- Don't install separate command symlink in binary directory for 'lvm devtypes'.
+ Don't install separate command symlink for 'lvm devtypes'. (2.02.101)
Add seg_size_pe field to reports.
Support start+length notation with command line PE ranges.
Exit cleanly with message when pvmove cannot restart because LV is inactive.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index dfc2d89..9dfd9bf 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.82 -
-=====================================
+Version 1.02.82 - 4th October 2013
+==================================
Define symbolic names for subsystem udev flags in libdevmapper for easier use.
Make subsystem udev rules responsible for importing DM_SUBSYSTEM_UDEV_FLAG*.
diff --git a/conf/example.conf.in b/conf/example.conf.in
index e0f8be8..ae571b6 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -255,7 +255,7 @@ allocation {
# Specify chunk size calculation policy for thin pool volumes.
# Possible options are:
# "generic" - if thin_pool_chunk_size is defined, use it.
- # Otherwise, calcucate the chunk size based on
+ # Otherwise, calculate the chunk size based on
# estimation and device hints exposed in sysfs:
# the minimum_io_size. The chunk size is always
# at least 64KiB.
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index fc2d4dc..bd7a40a 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -141,9 +141,9 @@
# define DEFAULT_ACTIVATION 0
#endif
-# define DEFAULT_RESERVED_MEMORY 8192
-# define DEFAULT_RESERVED_STACK 64 /* KB */
-# define DEFAULT_PROCESS_PRIORITY -18
+#define DEFAULT_RESERVED_MEMORY 8192
+#define DEFAULT_RESERVED_STACK 64 /* KB */
+#define DEFAULT_PROCESS_PRIORITY -18
#define DEFAULT_AUTO_SET_ACTIVATION_SKIP 1
#define DEFAULT_USE_LINEAR_TARGET 1
10 years, 7 months
master - lvmetad: Fix vgname->vgid hash updates w/ duplicate VG names.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0d03503a453f91...
Commit: 0d03503a453f91cee09fb3a1664d2136d58ac751
Parent: a7ff7aee4f49015db03536bbaee13b9795d63e6c
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Fri Oct 4 14:30:00 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Fri Oct 4 14:31:45 2013 +0200
lvmetad: Fix vgname->vgid hash updates w/ duplicate VG names.
---
daemons/lvmetad/lvmetad-core.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 4f7bf59..e1ec5a8 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -753,8 +753,11 @@ static int update_metadata(lvmetad_state *s, const char *name, const char *_vgid
dm_hash_insert(s->vgid_to_vgname, vgid, cfgname) &&
dm_hash_insert(s->vgname_to_vgid, name, (void*) vgid)) ? 1 : 0;
- if (retval && oldname && strcmp(name, oldname))
- dm_hash_remove(s->vgname_to_vgid, oldname);
+ if (retval && oldname && strcmp(name, oldname)) {
+ const char *vgid_prev = dm_hash_lookup(s->vgname_to_vgid, oldname);
+ if (vgid_prev && !strcmp(vgid_prev, vgid))
+ dm_hash_remove(s->vgname_to_vgid, oldname);
+ }
if (haveseq >= 0 && haveseq < seq)
dm_config_destroy(old);
10 years, 7 months
master - WHATS_NEW: renamed thin_pool_chunk_size_calculation -> policy
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a7ff7aee4f4901...
Commit: a7ff7aee4f49015db03536bbaee13b9795d63e6c
Parent: 8cf0810d57a0c47173c4775a08dd728c452f8eb8
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 4 12:36:32 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 4 12:36:32 2013 +0200
WHATS_NEW: renamed thin_pool_chunk_size_calculation -> policy
---
WHATS_NEW | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index cfcd8c9..0b71786 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -5,7 +5,7 @@ Version 2.02.103 -
Fix RAID calculation for sufficient allocatable space.
Conversion from linear to mirror or RAID1 now honors mirror_segtype_default.
Add thin-performance configuration profile.
- Add lvm.conf allocation/thin_pool_chunk_size_calculation option.
+ Add lvm.conf allocation/thin_pool_chunk_size_policy option.
Fix contiguous & cling allocation policies for parity RAID. (2.02.100)
Have lvmconf --enable/disable-cluster reset/set use_lvmetad.
Don't install separate command symlink in binary directory for 'lvm devtypes'.
10 years, 7 months
master - thin: rename thin_pool_chunk_size_calculation -> ..size_policy and rename "default" policy to "generic"
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8cf0810d57a0c4...
Commit: 8cf0810d57a0c47173c4775a08dd728c452f8eb8
Parent: baf95bbff70bdd1474b678f37b840025295903ae
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 4 12:30:33 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 4 12:30:33 2013 +0200
thin: rename thin_pool_chunk_size_calculation -> ..size_policy and rename "default" policy to "generic"
Just to be consistent with existing naming we use.
---
conf/example.conf.in | 6 +++---
lib/config/config_settings.h | 2 +-
lib/config/defaults.h | 2 +-
lib/metadata/metadata-exported.h | 2 +-
lib/metadata/thin_manip.c | 6 +++---
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index f06b705..e0f8be8 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -252,9 +252,9 @@ allocation {
# be placed on different PVs from the pool data.
thin_pool_metadata_require_separate_pvs = 0
- # Specify chunk size calculation method for thin pool volumes.
+ # Specify chunk size calculation policy for thin pool volumes.
# Possible options are:
- # "default" - if thin_pool_chunk_size is defined, use it.
+ # "generic" - if thin_pool_chunk_size is defined, use it.
# Otherwise, calcucate the chunk size based on
# estimation and device hints exposed in sysfs:
# the minimum_io_size. The chunk size is always
@@ -265,7 +265,7 @@ allocation {
# performance based on device hints exposed in
# sysfs: the optimal_io_size. The chunk size is
# always at least 512KiB.
- # thin_pool_chunk_size_calculation = "default"
+ # thin_pool_chunk_size_policy = "generic"
# Specify the minimal chunk size (in KB) for thin pool volumes.
# Use of the larger chunk size may improve perfomance for plain
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index f7c1330..c935920 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -107,7 +107,7 @@ cfg(allocation_mirror_logs_require_separate_pvs_CFG, "mirror_logs_require_separa
cfg(allocation_thin_pool_metadata_require_separate_pvs_CFG, "thin_pool_metadata_require_separate_pvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS, vsn(2, 2, 89), NULL)
cfg(allocation_thin_pool_zero_CFG, "thin_pool_zero", allocation_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_ZERO, vsn(2, 2, 99), NULL)
cfg(allocation_thin_pool_discards_CFG, "thin_pool_discards", allocation_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_STRING, DEFAULT_THIN_POOL_DISCARDS, vsn(2, 2, 99), NULL)
-cfg(allocation_thin_pool_chunk_size_calculation_CFG, "thin_pool_chunk_size_calculation", allocation_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_STRING, DEFAULT_THIN_POOL_CHUNK_SIZE_CALCULATION, vsn(2, 2, 101), NULL)
+cfg(allocation_thin_pool_chunk_size_policy_CFG, "thin_pool_chunk_size_policy", allocation_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_STRING, DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY, vsn(2, 2, 101), NULL)
cfg(allocation_thin_pool_chunk_size_CFG, "thin_pool_chunk_size", allocation_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_INT, 0, vsn(2, 2, 99), NULL)
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index cd3b5f9..fc2d4dc 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -71,7 +71,7 @@
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024) /* KB */
#define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048 /* KB */
#define DEFAULT_THIN_POOL_OPTIMAL_SIZE (128 * 1024 * 1024) /* KB */
-#define DEFAULT_THIN_POOL_CHUNK_SIZE_CALCULATION "default"
+#define DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY "generic"
#define DEFAULT_THIN_POOL_CHUNK_SIZE 64 /* KB */
#define DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE 512 /* KB */
#define DEFAULT_THIN_POOL_DISCARDS "passdown"
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 71fe393..971f677 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -726,7 +726,7 @@ struct lvcreate_params {
int activation_skip; /* activation skip flags */
activation_change_t activate; /* non-snapshot, non-mirror */
thin_discards_t discards; /* thin */
-#define THIN_CHUNK_SIZE_CALC_METHOD_DEFAULT 0x01
+#define THIN_CHUNK_SIZE_CALC_METHOD_GENERIC 0x01
#define THIN_CHUNK_SIZE_CALC_METHOD_PERFORMANCE 0x02
int thin_chunk_size_calc_method;
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index c71b971..f85696c 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -573,8 +573,8 @@ static int _get_pool_chunk_size_calc(const char *str,
int *chunk_size_calc_method,
uint32_t *chunk_size)
{
- if (!strcasecmp(str, "default")) {
- *chunk_size_calc_method = THIN_CHUNK_SIZE_CALC_METHOD_DEFAULT;
+ if (!strcasecmp(str, "generic")) {
+ *chunk_size_calc_method = THIN_CHUNK_SIZE_CALC_METHOD_GENERIC;
*chunk_size = DEFAULT_THIN_POOL_CHUNK_SIZE * 2;
}
else if (!strcasecmp(str, "performance")) {
@@ -598,7 +598,7 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi
if (!(passed_args & PASS_ARG_CHUNK_SIZE)) {
if (!(*chunk_size = find_config_tree_int(cmd, allocation_thin_pool_chunk_size_CFG, profile) * 2)) {
- str = find_config_tree_str(cmd, allocation_thin_pool_chunk_size_calculation_CFG, profile);
+ str = find_config_tree_str(cmd, allocation_thin_pool_chunk_size_policy_CFG, profile);
if (!_get_pool_chunk_size_calc(str, chunk_size_calc_method, chunk_size))
return_0;
}
10 years, 7 months
master - cmdline: Add --ignoreskippedcluster.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=baf95bbff70bdd...
Commit: baf95bbff70bdd1474b678f37b840025295903ae
Parent: 23ce3352d7e6ad122b3b173ffb739848bec6a7bd
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Oct 1 21:20:10 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Oct 1 21:20:10 2013 +0100
cmdline: Add --ignoreskippedcluster.
Accept --ignoreskippedcluster with pvs, vgs, lvs, pvdisplay, vgdisplay,
lvdisplay, vgchange and lvchange to avoid the 'Skipping clustered
VG' errors when requesting information about a clustered VG
without using clustered locking and still exit with success.
The messages can still be seen with -v.
---
WHATS_NEW | 3 +-
lib/commands/toolcontext.c | 1 +
lib/commands/toolcontext.h | 1 +
lib/metadata/metadata.c | 10 ++++++-
man/lvchange.8.in | 1 +
man/lvdisplay.8.in | 2 +
man/lvm.8.in | 5 ++++
man/lvs.8.in | 1 +
man/pvdisplay.8.in | 1 +
man/pvs.8.in | 1 +
man/vgchange.8.in | 1 +
man/vgdisplay.8.in | 2 +
man/vgs.8.in | 1 +
tools/args.h | 1 +
tools/commands.h | 40 +++++++++++++++++++++++----------
tools/lvmcmdline.c | 2 +
tools/pvdisplay.c | 7 ++---
tools/reporter.c | 22 ++++++++++++-----
tools/toollib.c | 53 +++++++++++++++++++++++++++++--------------
tools/toollib.h | 2 +
20 files changed, 114 insertions(+), 43 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index b813eb6..cfcd8c9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,12 +1,13 @@
Version 2.02.103 -
======================================
+ Add --ignoreskippedcluster for exit status success when clustered VGs skipped.
Fix 3min udev timeout so that it is applied for all LVM volumes.
Fix RAID calculation for sufficient allocatable space.
Conversion from linear to mirror or RAID1 now honors mirror_segtype_default.
Add thin-performance configuration profile.
Add lvm.conf allocation/thin_pool_chunk_size_calculation option.
Fix contiguous & cling allocation policies for parity RAID. (2.02.100)
- Set use_lvmetad=0 on lvmconf --enable-cluster, reset to default on --disable-cluster.
+ Have lvmconf --enable/disable-cluster reset/set use_lvmetad.
Don't install separate command symlink in binary directory for 'lvm devtypes'.
Add seg_size_pe field to reports.
Support start+length notation with command line PE ranges.
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 4f53f0e..2732094 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1396,6 +1396,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
cmd->handles_missing_pvs = 0;
cmd->handles_unknown_segments = 0;
cmd->independent_metadata_areas = 0;
+ cmd->ignore_clustered_vgs = 0;
cmd->hosttags = 0;
dm_list_init(&cmd->arg_value_groups);
dm_list_init(&cmd->formats);
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index cd91605..74b1177 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -90,6 +90,7 @@ struct cmd_context {
unsigned auto_set_activation_skip:1;
unsigned si_unit_consistency:1;
unsigned metadata_read_only:1;
+ unsigned ignore_clustered_vgs:1;
unsigned threaded:1; /* Set if running within a thread e.g. clvmd */
unsigned independent_metadata_areas:1; /* Active formats have MDAs outside PVs */
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 1e34f83..4ffd502 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4005,7 +4005,10 @@ static uint32_t _vg_bad_status_bits(const struct volume_group *vg,
if ((status & CLUSTERED) &&
(vg_is_clustered(vg)) && !locking_is_clustered()) {
- log_error("Skipping clustered volume group %s", vg->name);
+ if (!vg->cmd->ignore_clustered_vgs)
+ log_error("Skipping clustered volume group %s", vg->name);
+ else
+ log_verbose("Skipping clustered volume group %s", vg->name);
/* Return because other flags are considered undefined. */
return FAILED_CLUSTERED;
}
@@ -4123,7 +4126,10 @@ static struct volume_group *_vg_lock_and_read(struct cmd_context *cmd, const cha
}
if (vg_is_clustered(vg) && !locking_is_clustered()) {
- log_error("Skipping clustered volume group %s", vg->name);
+ if (!cmd->ignore_clustered_vgs)
+ log_error("Skipping clustered volume group %s", vg->name);
+ else
+ log_verbose("Skipping clustered volume group %s", vg->name);
failure |= FAILED_CLUSTERED;
goto bad;
}
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index ea8a6ef..49337e4 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -27,6 +27,7 @@ lvchange \- change attributes of a logical volume
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
.RB [ \-\-ignoremonitoring ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-monitor
.RI { y | n }]
.RB [ \-\-poll
diff --git a/man/lvdisplay.8.in b/man/lvdisplay.8.in
index 84f21d3..49654bc 100644
--- a/man/lvdisplay.8.in
+++ b/man/lvdisplay.8.in
@@ -8,6 +8,7 @@ lvdisplay \- display attributes of a logical volume
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-maps ]
.RB [ \-\-nosuffix ]
.RB [ \-P | \-\-partial ]
@@ -26,6 +27,7 @@ lvdisplay \- display attributes of a logical volume
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
diff --git a/man/lvm.8.in b/man/lvm.8.in
index da471ab..13e66d0 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -216,6 +216,11 @@ This lets you proceed with read-only metadata operations such as
One use for this is in a system init script if the lock directory
is mounted read-only when the script runs.
.TP
+.B \-\-ignoreskippedcluster
+Use to avoid exiting with an non-zero status code if the command is run
+without clustered locking and some clustered Volume Groups have to be
+skipped over.
+.TP
.B \-\-addtag \fITag
Add the tag \fITag\fP to a PV, VG or LV.
Supply this argument multiple times to add more than one tag at once.
diff --git a/man/lvs.8.in b/man/lvs.8.in
index 85f7d33..8427aca 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -8,6 +8,7 @@ lvs \- report information about logical volumes
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-nameprefixes ]
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
index 6a8a0d0..03c12c4 100644
--- a/man/pvdisplay.8.in
+++ b/man/pvdisplay.8.in
@@ -7,6 +7,7 @@ pvdisplay \- display attributes of a physical volume
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-maps ]
.RB [ \-\-nosuffix ]
.RB [ \-s | \-\-short ]
diff --git a/man/pvs.8.in b/man/pvs.8.in
index d1f6e8b..67e395b 100644
--- a/man/pvs.8.in
+++ b/man/pvs.8.in
@@ -8,6 +8,7 @@ pvs \- report information about physical volumes
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-nameprefixes ]
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
diff --git a/man/vgchange.8.in b/man/vgchange.8.in
index 97042b1..e687587 100644
--- a/man/vgchange.8.in
+++ b/man/vgchange.8.in
@@ -29,6 +29,7 @@ vgchange \- change attributes of a volume group
.RB [ \-h | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
.RB [ \-\-ignoremonitoring ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-sysinit ]
.RB [ \-\-noudevsync ]
.RB [ \-l | \-\-logicalvolume
diff --git a/man/vgdisplay.8.in b/man/vgdisplay.8.in
index 70c1fa7..9016a45 100644
--- a/man/vgdisplay.8.in
+++ b/man/vgdisplay.8.in
@@ -10,6 +10,7 @@ vgdisplay \- display attributes of volume groups
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-nosuffix ]
.RB [ \-P | \-\-partial ]
.RB [ \-\-units
@@ -26,6 +27,7 @@ vgdisplay \- display attributes of volume groups
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o|\-\-options
diff --git a/man/vgs.8.in b/man/vgs.8.in
index 381e3a9..eae60fa 100644
--- a/man/vgs.8.in
+++ b/man/vgs.8.in
@@ -8,6 +8,7 @@ vgs \- report information about volume groups
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
+.RB [ \-\-ignoreskippedcluster ]
.RB [ \-\-nameprefixes ]
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
diff --git a/tools/args.h b/tools/args.h
index c5e4d14..27b97eb 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -100,6 +100,7 @@ arg(raidmaxrecoveryrate_ARG, '\0', "raidmaxrecoveryrate", size_kb_arg, 0)
arg(profile_ARG, '\0', "profile", string_arg, 0)
arg(detachprofile_ARG, '\0', "detachprofile", NULL, 0)
arg(mergedconfig_ARG, '\0', "mergedconfig", NULL, 0)
+arg(ignoreskippedcluster_ARG, '\0', "ignoreskippedcluster", NULL, 0)
/* Allow some variations */
arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0)
diff --git a/tools/commands.h b/tools/commands.h
index a0cd5d7..c299276 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -107,6 +107,7 @@ xx(lvchange,
"\t[--discards {ignore|nopassdown|passdown}]\n"
"\t[--ignorelockingfailure]\n"
"\t[--ignoremonitoring]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-k|--setactivationskip {y|n}]\n"
"\t[-K|--ignoreactivationskip] \n"
"\t[--monitor {y|n}]\n"
@@ -135,6 +136,7 @@ xx(lvchange,
addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG,
contiguous_ARG, deltag_ARG, discards_ARG, detachprofile_ARG, force_ARG,
ignorelockingfailure_ARG, ignoremonitoring_ARG, ignoreactivationskip_ARG,
+ ignoreskippedcluster_ARG,
major_ARG, minor_ARG, monitor_ARG, minrecoveryrate_ARG, maxrecoveryrate_ARG,
noudevsync_ARG, partial_ARG, permission_ARG, persistent_ARG, poll_ARG,
profile_ARG, raidminrecoveryrate_ARG, raidmaxrecoveryrate_ARG,
@@ -303,6 +305,7 @@ xx(lvdisplay,
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-m|--maps]\n"
"\t[--nosuffix]\n"
"\t[-P|--partial] " "\n"
@@ -317,6 +320,7 @@ xx(lvdisplay,
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[-o|--options [+]Field[,Field]]\n"
@@ -330,8 +334,8 @@ xx(lvdisplay,
"\t[--version]" "\n"
"\t[LogicalVolume[Path] [LogicalVolume[Path]...]]\n",
- aligned_ARG, all_ARG, colon_ARG, columns_ARG,
- ignorelockingfailure_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG,
+ aligned_ARG, all_ARG, colon_ARG, columns_ARG, ignorelockingfailure_ARG,
+ ignoreskippedcluster_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG,
options_ARG, sort_ARG, partial_ARG, segments_ARG, separator_ARG,
unbuffered_ARG, units_ARG)
@@ -502,6 +506,7 @@ xx(lvs,
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
@@ -519,7 +524,8 @@ xx(lvs,
"\t[--version]" "\n"
"\t[LogicalVolume[Path] [LogicalVolume[Path]...]]\n",
- aligned_ARG, all_ARG, ignorelockingfailure_ARG, nameprefixes_ARG,
+ aligned_ARG, all_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
+ nameprefixes_ARG,
noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG,
rows_ARG, segments_ARG, separator_ARG, sort_ARG, trustcache_ARG,
unbuffered_ARG, units_ARG, unquoted_ARG)
@@ -646,6 +652,7 @@ xx(pvdisplay,
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-m|--maps]\n"
"\t[--nosuffix]\n"
"\t[-s|--short]\n"
@@ -660,6 +667,7 @@ xx(pvdisplay,
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[-o|--options [+]Field[,Field]]\n"
@@ -672,8 +680,8 @@ xx(pvdisplay,
"\t[PhysicalVolumePath [PhysicalVolumePath...]]\n",
aligned_ARG, all_ARG, colon_ARG, columns_ARG, ignorelockingfailure_ARG,
- maps_ARG, noheadings_ARG, nosuffix_ARG, options_ARG, separator_ARG,
- short_ARG, sort_ARG, unbuffered_ARG, units_ARG)
+ ignoreskippedcluster_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG,
+ options_ARG, separator_ARG, short_ARG, sort_ARG, unbuffered_ARG, units_ARG)
xx(pvmove,
"Move extents from one physical volume to another",
@@ -722,6 +730,7 @@ xx(pvs,
"\t[-d|--debug]" "\n"
"\t[-h|-?|--help] " "\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
@@ -739,10 +748,10 @@ xx(pvs,
"\t[--version]\n"
"\t[PhysicalVolume [PhysicalVolume...]]\n",
- aligned_ARG, all_ARG, ignorelockingfailure_ARG, nameprefixes_ARG,
- noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG,
- rows_ARG, segments_ARG, separator_ARG, sort_ARG, trustcache_ARG,
- unbuffered_ARG, units_ARG, unquoted_ARG)
+ aligned_ARG, all_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
+ nameprefixes_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG,
+ partial_ARG, rows_ARG, segments_ARG, separator_ARG, sort_ARG,
+ trustcache_ARG, unbuffered_ARG, units_ARG, unquoted_ARG)
xx(pvscan,
"List all physical volumes",
@@ -813,6 +822,7 @@ xx(vgchange,
"\t[-h|--help] " "\n"
"\t[--ignorelockingfailure]\n"
"\t[--ignoremonitoring]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[-K|--ignoreactivationskip] \n"
"\t[--monitor {y|n}]\n"
"\t[--[vg]metadatacopies #copies] " "\n"
@@ -838,6 +848,7 @@ xx(vgchange,
addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG, activate_ARG,
available_ARG, clustered_ARG, deltag_ARG, detachprofile_ARG,
ignoreactivationskip_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG,
+ ignoreskippedcluster_ARG,
logicalvolume_ARG, maxphysicalvolumes_ARG, monitor_ARG, noudevsync_ARG,
metadatacopies_ARG, vgmetadatacopies_ARG, partial_ARG, profile_ARG,
physicalextentsize_ARG, poll_ARG, refresh_ARG, resizeable_ARG,
@@ -910,6 +921,7 @@ xx(vgdisplay,
"\t[-d|--debug] " "\n"
"\t[-h|--help] " "\n"
"\t[--ignorelockingfailure]" "\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nosuffix]\n"
"\t[-P|--partial] " "\n"
"\t[--units hHbBsSkKmMgGtTpPeE]\n"
@@ -921,6 +933,7 @@ xx(vgdisplay,
"\t[-d|--debug] " "\n"
"\t[-h|--help] " "\n"
"\t[--ignorelockingfailure]" "\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
"\t[-o|--options [+]Field[,Field]]\n"
@@ -934,8 +947,9 @@ xx(vgdisplay,
"\t[VolumeGroupName [VolumeGroupName...]]\n",
activevolumegroups_ARG, aligned_ARG, colon_ARG, columns_ARG,
- ignorelockingfailure_ARG, noheadings_ARG, nosuffix_ARG, options_ARG,
- partial_ARG, short_ARG, separator_ARG, sort_ARG, unbuffered_ARG, units_ARG)
+ ignorelockingfailure_ARG, ignoreskippedcluster_ARG, noheadings_ARG,
+ nosuffix_ARG, options_ARG, partial_ARG, short_ARG, separator_ARG,
+ sort_ARG, unbuffered_ARG, units_ARG)
xx(vgexport,
"Unregister volume group(s) from the system",
@@ -1075,6 +1089,7 @@ xx(vgs,
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
"\t[--ignorelockingfailure]\n"
+ "\t[--ignoreskippedcluster]\n"
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
@@ -1091,7 +1106,8 @@ xx(vgs,
"\t[--version]\n"
"\t[VolumeGroupName [VolumeGroupName...]]\n",
- aligned_ARG, all_ARG, ignorelockingfailure_ARG, nameprefixes_ARG,
+ aligned_ARG, all_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
+ nameprefixes_ARG,
noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG,
rows_ARG, separator_ARG, sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG,
unquoted_ARG)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index e004f61..6fe4670 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -906,6 +906,8 @@ static int _get_settings(struct cmd_context *cmd)
else
init_ignorelockingfailure(0);
+ cmd->ignore_clustered_vgs = arg_count(cmd, ignoreskippedcluster_ARG) ? 1 : 0;
+
if (!arg_count(cmd, sysinit_ARG))
lvmetad_connect_or_warn();
diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c
index c6cd412..35fb75b 100644
--- a/tools/pvdisplay.c
+++ b/tools/pvdisplay.c
@@ -30,11 +30,10 @@ static int _pvdisplay_single(struct cmd_context *cmd,
if (!is_orphan(pv) && !vg) {
vg_name = pv_vg_name(pv);
vg = vg_read(cmd, vg_name, (char *)&pv->vgid, 0);
- if (vg_read_error(vg)) {
- log_error("Skipping volume group %s", vg_name);
+ if (ignore_vg(vg, vg_name, 0, &ret)) {
release_vg(vg);
- /* FIXME If CLUSTERED should return ECMD_PROCESSED here */
- return ECMD_FAILED;
+ stack;
+ return ret;
}
/*
diff --git a/tools/reporter.c b/tools/reporter.c
index 44a9aa8..a967f60 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -145,10 +145,10 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg,
vg_name = pv_vg_name(pv);
vg = vg_read(cmd, vg_name, (char *)&pv->vgid, 0);
- if (vg_read_error(vg)) {
- log_error("Skipping volume group %s", vg_name);
+ if (ignore_vg(vg, vg_name, 0, &ret)) {
release_vg(vg);
- return ECMD_FAILED;
+ stack;
+ return ret;
}
/*
@@ -205,8 +205,12 @@ static int _pvs_in_vg(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
void *handle)
{
- if (vg_read_error(vg))
- return_ECMD_FAILED;
+ int ret = ECMD_PROCESSED;
+
+ if (ignore_vg(vg, vg_name, 0, &ret)) {
+ stack;
+ return ret;
+ }
return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvs_single);
}
@@ -215,8 +219,12 @@ static int _pvsegs_in_vg(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
void *handle)
{
- if (vg_read_error(vg))
- return_ECMD_FAILED;
+ int ret = ECMD_PROCESSED;
+
+ if (ignore_vg(vg, vg_name, 0, &ret)) {
+ stack;
+ return ret;
+ }
return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvsegs_single);
}
diff --git a/tools/toollib.c b/tools/toollib.c
index 9b3e842..bc8b33c 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -156,6 +156,29 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
}
/*
+ * Returns 1 if VG should be ignored.
+ */
+int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *ret)
+{
+ uint32_t read_error = vg_read_error(vg);
+
+ if (!read_error)
+ return 0;
+
+ if ((read_error == FAILED_INCONSISTENT) && allow_inconsistent)
+ return 0;
+
+ if (read_error == FAILED_CLUSTERED && vg->cmd->ignore_clustered_vgs)
+ log_verbose("Skipping volume group %s", vg_name);
+ else {
+ log_error("Skipping volume group %s", vg_name);
+ *ret = ECMD_FAILED;
+ }
+
+ return 1;
+}
+
+/*
* Metadata iteration functions
*/
int process_each_lv_in_vg(struct cmd_context *cmd,
@@ -404,12 +427,10 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv,
return_ECMD_FAILED;
if (!cmd_vg_read(cmd, &cmd_vgs)) {
- free_cmd_vgs(&cmd_vgs);
- if (ret_max < ECMD_FAILED) {
- log_error("Skipping volume group %s", vgname);
- ret_max = ECMD_FAILED;
- } else
+ if (ignore_vg(cvl_vg->vg, vgname, 0, &ret_max))
stack;
+
+ free_cmd_vgs(&cmd_vgs);
continue;
}
@@ -489,10 +510,10 @@ int process_each_segment_in_pv(struct cmd_context *cmd,
vg_name = pv_vg_name(pv);
vg = vg_read(cmd, vg_name, NULL, 0);
- if (vg_read_error(vg)) {
+ if (ignore_vg(vg, vg_name, 0, &ret)) {
release_vg(vg);
- log_error("Skipping volume group %s", vg_name);
- return ECMD_FAILED;
+ stack;
+ return ret;
}
/*
@@ -561,13 +582,13 @@ static int _process_one_vg(struct cmd_context *cmd, const char *vg_name,
{
struct dm_list cmd_vgs;
struct cmd_vg *cvl_vg;
- int ret = 0;
+ int ret = ECMD_PROCESSED;
log_verbose("Finding volume group \"%s\"", vg_name);
dm_list_init(&cmd_vgs);
if (!(cvl_vg = cmd_vg_add(cmd->mem, &cmd_vgs, vg_name, vgid, flags)))
- return_0;
+ return_ECMD_FAILED;
for (;;) {
if (sigint_caught()) {
@@ -575,15 +596,14 @@ static int _process_one_vg(struct cmd_context *cmd, const char *vg_name,
stack;
break;
}
- if (!cmd_vg_read(cmd, &cmd_vgs))
+
+ if (!cmd_vg_read(cmd, &cmd_vgs)) {
/* Allow FAILED_INCONSISTENT through only for vgcfgrestore */
- if (vg_read_error(cvl_vg->vg) &&
- (!((flags & READ_ALLOW_INCONSISTENT) &&
- (vg_read_error(cvl_vg->vg) == FAILED_INCONSISTENT)))) {
- ret = ECMD_FAILED;
+ if (ignore_vg(cvl_vg->vg, vg_name, flags & READ_ALLOW_INCONSISTENT, &ret)) {
stack;
break;
}
+ }
if (!dm_list_empty(tags) &&
/* Only process if a tag matches or it's on arg_vgnames */
@@ -889,8 +909,7 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
goto_out;
}
vg = vg_read(cmd, sll->str, NULL, flags);
- if (vg_read_error(vg)) {
- ret_max = ECMD_FAILED;
+ if (ignore_vg(vg, sll->str, 0, &ret_max)) {
release_vg(vg);
stack;
continue;
diff --git a/tools/toollib.h b/tools/toollib.h
index d831b95..aa6f699 100644
--- a/tools/toollib.h
+++ b/tools/toollib.h
@@ -25,6 +25,8 @@ int autobackup_init(const char *backup_dir, int keep_days, int keep_number,
int autobackup);
int autobackup(struct volume_group *vg);
+int ignore_vg(struct volume_group *vg, const char *vg_name, int allow_inconsistent, int *ret);
+
struct volume_group *recover_vg(struct cmd_context *cmd, const char *vgname,
uint32_t lock_type);
10 years, 7 months