master - metadata: print VG with invalid chars in quotes
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=013f5f4550816b...
Commit: 013f5f4550816b0ac0d7f7a92ce763624b351319
Parent: 6a8d3d781112acdddf8fbb671bf9b68837f11c63
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 19 00:24:36 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 19 00:48:39 2014 +0100
metadata: print VG with invalid chars in quotes
We we report invalid chars, put quotes around vg name.
---
lib/metadata/metadata.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 278b519..b5e2ed6 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4166,7 +4166,7 @@ static struct volume_group *_vg_lock_and_read(struct cmd_context *cmd, const cha
consistent = 0;
if (!validate_name(vg_name) && !is_orphan_vg(vg_name)) {
- log_error("Volume group name %s has invalid characters",
+ log_error("Volume group name \"%s\" has invalid characters.",
vg_name);
return NULL;
}
9 years, 8 months
master - clvmd: avoid resending local sync commands
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6a8d3d781112ac...
Commit: 6a8d3d781112acdddf8fbb671bf9b68837f11c63
Parent: a6b159e99c18905370c6cfed316f3fa1b189c7ae
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 19 00:25:51 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 19 00:47:58 2014 +0100
clvmd: avoid resending local sync commands
Instead of sending repeatedly LOCAL_SYNC commands to clvmds
like 'lvs', rememeber the last sent commmand, and if there was no other
clvmd command, drop this redundant SYNC call message.
The problem has started with commit:
56cab8cc037fc4d31085705987b3a4c04d5e5938
This introduced correct synchronisation of name, when user requests to know
open_count (needs to wait for udev), however it is also executed for
read-only cases like 'lvs' command.
For now implement very simple solution, which is only monitoring
outgoing clvmd command, and when sequence of LOCAL sync names are
recognized, they are skipped automatically.
TODO:
Future solution might move this variable info 'cmd_context' and
use 'needs_sync' flag also i.e. in file locking code.
---
WHATS_NEW | 1 +
lib/locking/cluster_locking.c | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bbc2298..08d5b1d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Skip redundant synchronization calls on local clvmd.
Use correct PATH_MAX for locking dir path.
Do not check for backups when when its creation is disabled.
Don't allow --mergedconfig without --type current in dumpconfig. Fix memleak.
diff --git a/lib/locking/cluster_locking.c b/lib/locking/cluster_locking.c
index 7cbb8f1..86e6c77 100644
--- a/lib/locking/cluster_locking.c
+++ b/lib/locking/cluster_locking.c
@@ -301,6 +301,8 @@ static int _cluster_free_request(lvm_response_t * response, int num)
static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
uint32_t flags, const char *name)
{
+ /* TODO: convert to global usable solution and move static into cmd */
+ static unsigned char last_clvmd_cmd = 0;
int status;
int i;
char *args;
@@ -360,8 +362,13 @@ static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
* SYNC_NAMES and VG_BACKUP use the VG name directly without prefix.
*/
if (clvmd_cmd == CLVMD_CMD_SYNC_NAMES) {
- if (flags & LCK_LOCAL)
+ if (flags & LCK_LOCAL) {
node = NODE_LOCAL;
+ if (clvmd_cmd == last_clvmd_cmd) {
+ log_debug("Skipping redundant local sync command.");
+ return 1;
+ }
+ }
} else if (clvmd_cmd != CLVMD_CMD_VG_BACKUP) {
if (strncmp(name, "P_", 2) &&
(clvmd_cmd == CLVMD_CMD_LOCK_VG ||
@@ -372,6 +379,7 @@ static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
node = NODE_REMOTE;
}
+ last_clvmd_cmd = clvmd_cmd;
status = _cluster_request(clvmd_cmd, node, args, len,
&response, &num_responses);
9 years, 8 months
master - file_locking: use PATH_MAX for dir name
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a6b159e99c1890...
Commit: a6b159e99c18905370c6cfed316f3fa1b189c7ae
Parent: 08018a5345c98b91ce43eb55f4110485df9eb3aa
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 19 00:22:18 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 19 00:46:28 2014 +0100
file_locking: use PATH_MAX for dir name
Using just 128 chars for locking dir may wail if longer
dir entry is used, swich to default linux max path.
---
WHATS_NEW | 1 +
lib/locking/file_locking.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index e2c196a..bbc2298 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Use correct PATH_MAX for locking dir path.
Do not check for backups when when its creation is disabled.
Don't allow --mergedconfig without --type current in dumpconfig. Fix memleak.
Make global/lvdisplay_shows_full_device_path lvm.conf setting profilable.
diff --git a/lib/locking/file_locking.c b/lib/locking/file_locking.c
index fb84c5b..734e0b4 100644
--- a/lib/locking/file_locking.c
+++ b/lib/locking/file_locking.c
@@ -37,7 +37,7 @@ struct lock_list {
};
static struct dm_list _lock_list;
-static char _lock_dir[NAME_LEN];
+static char _lock_dir[PATH_MAX];
static int _prioritise_write_locks;
static sig_t _oldhandler;
9 years, 8 months
master - archiver: drop unneeded backup check
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=08018a5345c98b...
Commit: 08018a5345c98b91ce43eb55f4110485df9eb3aa
Parent: 25f5e2da8d6b447d26395e610e55192d2d8a16b4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 19 00:20:39 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 19 00:45:41 2014 +0100
archiver: drop unneeded backup check
When the backup is disabled, avoid testing backup presence.
This only leads to errors being logged in debug trace and the missing
backup can't be fixed, since it's disabled.
---
WHATS_NEW | 1 +
lib/format_text/archiver.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index de96f8a..e2c196a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Do not check for backups when when its creation is disabled.
Don't allow --mergedconfig without --type current in dumpconfig. Fix memleak.
Make global/lvdisplay_shows_full_device_path lvm.conf setting profilable.
Make global/{units|si_unit_consistency|suffix} lvm.conf setting profilable.
diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c
index 31d17ef..2667bdb 100644
--- a/lib/format_text/archiver.c
+++ b/lib/format_text/archiver.c
@@ -487,6 +487,11 @@ void check_current_backup(struct volume_group *vg)
struct volume_group *vg_backup;
int old_suppress;
+ if (!vg->cmd->backup_params->enabled || !vg->cmd->backup_params->dir) {
+ log_debug("Skipping check for current backup, since backup is disabled.");
+ return;
+ }
+
if (vg_is_exported(vg))
return;
9 years, 8 months
master - dumpconfig: fix memleak when using --mergedconfig
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=25f5e2da8d6b44...
Commit: 25f5e2da8d6b447d26395e610e55192d2d8a16b4
Parent: aed36c12f8ceb55d3290519215adecc03d54978e
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 18 11:04:21 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 18 11:11:31 2014 +0100
dumpconfig: fix memleak when using --mergedconfig
Check whether lvm dumpconfig --mergedconfig is used only
with --type current (where we're merging current config and
the config supplied on command line). With other types
the config was merged, but it was thrown away since we're
generating other type of config anyway. This lead to a memleak.
Error out if --mergedconfig is used with anything else than
--type current (or without specifying --type in which case
the --type current is used by default).
---
WHATS_NEW | 1 +
tools/dumpconfig.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a20331b..de96f8a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Don't allow --mergedconfig without --type current in dumpconfig. Fix memleak.
Make global/lvdisplay_shows_full_device_path lvm.conf setting profilable.
Make global/{units|si_unit_consistency|suffix} lvm.conf setting profilable.
Validate minimal chunk size for snapshot COW volume in lvconvert.
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index dd86733..d9aebd9 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -126,6 +126,9 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
"no effect with --type current");
return EINVALID_CMD_LINE;
}
+ } else if (arg_count(cmd, mergedconfig_ARG)) {
+ log_error("--mergedconfig has no effect without --type current");
+ return EINVALID_CMD_LINE;
}
if (!_get_vsn(cmd, &tree_spec.version))
9 years, 8 months
master - tests: use check lv_tree_on
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aed36c12f8ceb5...
Commit: aed36c12f8ceb55d3290519215adecc03d54978e
Parent: 81166a84be44409ab326eb1c4760cb32a9aee0fe
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 18 10:26:42 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Mar 18 10:28:09 2014 +0100
tests: use check lv_tree_on
Use internal /lib function.
Reduce extent size for test to create smaller devices.
---
test/shell/lvresize-raid.sh | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvresize-raid.sh b/test/shell/lvresize-raid.sh
index 6908635..9b9218d 100644
--- a/test/shell/lvresize-raid.sh
+++ b/test/shell/lvresize-raid.sh
@@ -13,7 +13,9 @@
aux target_at_least dm-raid 1 1 0 || skip
-aux prepare_vg 6 80
+aux prepare_pvs 6 80
+
+vgcreate -s 256K $vg $(cat DEVICES)
for deactivate in true false; do
@@ -50,6 +52,6 @@ done
# Ensure extend is contiguous
lvcreate --type raid4 -l 2 -i 2 -n $lv1 $vg $dev4 $dev5 $dev6
lvextend -l +2 --alloc contiguous $vg/$lv1
-not $(lvs -a -o devices $vg | egrep "$dev1|$dev2|$dev3")
-lvremove -ff $vg
+check lv_tree_on $vg $lv1 "$dev4" "$dev5" "$dev6"
+vgremove -f $vg
9 years, 8 months
master - tests: more fedora kernels unusable for testing raid456
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=81166a84be4440...
Commit: 81166a84be44409ab326eb1c4760cb32a9aee0fe
Parent: 599a05f658326e8b683923e3255b3e05ccd54bb3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 18:38:59 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Mar 18 10:28:08 2014 +0100
tests: more fedora kernels unusable for testing raid456
---
test/lib/aux.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 63896d1..42ac0a5 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -682,6 +682,8 @@ raid456_replace_works() {
# so we need to put here exlusion for kernes which do trace SLUB
#
case $(uname -r) in
+ 3.6.*.fc18.i686*|3.6.*.fc18.x86_64) return 1 ;;
+ 3.9.*.fc19.i686*|3.9.*.fc19.x86_64) return 1 ;;
3.1[0123].*.fc18.i686*|3.1[0123].*.fc18.x86_64) return 1 ;;
3.1[0123].*.fc19.i686*|3.1[0123].*.fc19.x86_64) return 1 ;;
3.13.*.fc20.i686*|3.13.*.fc20.x86_64) return 1 ;;
9 years, 8 months
master - lvmcache: add mode debug prints
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=599a05f658326e...
Commit: 599a05f658326e8b683923e3255b3e05ccd54bb3
Parent: 21b3c983fddac7e1365b4929dc02ddf04cf817bc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 18 10:24:32 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Mar 18 10:28:08 2014 +0100
lvmcache: add mode debug prints
Decorate NULL returns with debug_cache output so the
debug log doesn't contain spurios <bactrace> line without
any reason for it.
Add internal errors when cache is misused.
---
lib/cache/lvmcache.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index d40bdce..f414aed 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -429,11 +429,15 @@ struct lvmcache_vginfo *lvmcache_vginfo_from_vgname(const char *vgname, const ch
if (!vgname)
return lvmcache_vginfo_from_vgid(vgid);
- if (!_vgname_hash)
+ if (!_vgname_hash) {
+ log_debug_cache(INTERNAL_ERROR "Internal cache is no yet initialized.");
return NULL;
+ }
- if (!(vginfo = dm_hash_lookup(_vgname_hash, vgname)))
+ if (!(vginfo = dm_hash_lookup(_vgname_hash, vgname))) {
+ log_debug_cache("Metadata cache has no info for vgname: \"%s\"", vgname);
return NULL;
+ }
if (vgid)
do
@@ -441,6 +445,10 @@ struct lvmcache_vginfo *lvmcache_vginfo_from_vgname(const char *vgname, const ch
return vginfo;
while ((vginfo = vginfo->next));
+ if (!vginfo)
+ log_debug_cache("Metadata cache has not found vgname \"%s\" with vgid \"%s\"",
+ vgname, vgid);
+
return vginfo;
}
@@ -514,15 +522,19 @@ struct lvmcache_vginfo *lvmcache_vginfo_from_vgid(const char *vgid)
struct lvmcache_vginfo *vginfo;
char id[ID_LEN + 1] __attribute__((aligned(8)));
- if (!_vgid_hash || !vgid)
+ if (!_vgid_hash || !vgid) {
+ log_debug_cache(INTERNAL_ERROR "Internal cache cannot lookup vgid.");
return NULL;
+ }
/* vgid not necessarily NULL-terminated */
strncpy(&id[0], vgid, ID_LEN);
id[ID_LEN] = '\0';
- if (!(vginfo = dm_hash_lookup(_vgid_hash, id)))
+ if (!(vginfo = dm_hash_lookup(_vgid_hash, id))) {
+ log_debug_cache("Metadata cache has no info for vgid \"%s\"", id);
return NULL;
+ }
return vginfo;
}
9 years, 8 months
master - config: make global/lvdisplay_shows_full_device_path profilable
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=21b3c983fddac7...
Commit: 21b3c983fddac7e1365b4929dc02ddf04cf817bc
Parent: 3a6bc7fc65ea57e84fb8705cb24f024b2d8302ed
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 18 09:49:53 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 18 09:49:53 2014 +0100
config: make global/lvdisplay_shows_full_device_path profilable
---
WHATS_NEW | 1 +
conf/default.profile.in | 1 +
lib/config/config_settings.h | 2 +-
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index de5dc0d..a20331b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Make global/lvdisplay_shows_full_device_path lvm.conf setting profilable.
Make global/{units|si_unit_consistency|suffix} lvm.conf setting profilable.
Validate minimal chunk size for snapshot COW volume in lvconvert.
Disallow lvconvert of origin to snapshot COW volume.
diff --git a/conf/default.profile.in b/conf/default.profile.in
index 72396e5..527edb2 100644
--- a/conf/default.profile.in
+++ b/conf/default.profile.in
@@ -24,6 +24,7 @@ global {
units="h"
si_unit_consistency=1
suffix=1
+ lvdisplay_shows_full_device_path=0
}
report {
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 72f99d5..6fcf1a7 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -172,7 +172,7 @@ cfg(global_detect_internal_vg_cache_corruption_CFG, "detect_internal_vg_cache_co
cfg(global_metadata_read_only_CFG, "metadata_read_only", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_METADATA_READ_ONLY, vsn(2, 2, 75), NULL)
cfg(global_mirror_segtype_default_CFG, "mirror_segtype_default", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_MIRROR_SEGTYPE, vsn(2, 2, 87), NULL)
cfg(global_raid10_segtype_default_CFG, "raid10_segtype_default", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_RAID10_SEGTYPE, vsn(2, 2, 99), NULL)
-cfg(global_lvdisplay_shows_full_device_path_CFG, "lvdisplay_shows_full_device_path", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH, vsn(2, 2, 89), NULL)
+cfg(global_lvdisplay_shows_full_device_path_CFG, "lvdisplay_shows_full_device_path", global_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH, vsn(2, 2, 89), NULL)
cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(2, 2, 93), NULL)
cfg(global_thin_check_executable_CFG, "thin_check_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, THIN_CHECK_CMD, vsn(2, 2, 94), NULL)
cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S" DEFAULT_THIN_CHECK_OPTIONS, vsn(2, 2, 96), NULL)
9 years, 8 months
master - WHATS_NEW: previous commit
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3a6bc7fc65ea57...
Commit: 3a6bc7fc65ea57e84fb8705cb24f024b2d8302ed
Parent: 927784cd063ebd4aa3a82ad815db9e1811a900c4
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 18 09:28:52 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 18 09:28:52 2014 +0100
WHATS_NEW: previous commit
---
WHATS_NEW | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f104a0c..de5dc0d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,6 @@
Version 2.02.106 -
====================================
- Make global/units and global/si_unit_consistency lvm.conf setting profilable.
+ Make global/{units|si_unit_consistency|suffix} lvm.conf setting profilable.
Validate minimal chunk size for snapshot COW volume in lvconvert.
Disallow lvconvert of origin to snapshot COW volume.
Make report lvm.conf settings profilable.
9 years, 8 months