master - test: fix filter
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=67fc56f5ca1e05...
Commit: 67fc56f5ca1e05f78cedc5f729745e176447c6b2
Parent: c7c5a840c1aca9712134b8afee8abcba5cb8116f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 23 14:28:27 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 23 14:28:27 2013 +0200
test: fix filter
Fix filter for use with real /dev
---
test/shell/mdata-strings.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/mdata-strings.sh b/test/shell/mdata-strings.sh
index 16e9360..95a630e 100644
--- a/test/shell/mdata-strings.sh
+++ b/test/shell/mdata-strings.sh
@@ -14,7 +14,7 @@
. lib/test
aux prepare_devs 2
-aux lvmconf 'devices/global_filter = [ "a|.*LVMTEST.*dev/mapper/.*pv[0-9_]*$|", "r|.*|" ]'
+aux lvmconf 'devices/global_filter = [ "a|.*dev/mapper/.*LVMTEST.*pv[0-9_]*$|", "r|.*|" ]'
# for udev impossible to create
pv_ugly="__\"!@#\$%^&*,()|@||'\\\"__pv1"
10 years, 12 months
master - test: new test new fail
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c7c5a840c1aca9...
Commit: c7c5a840c1aca9712134b8afee8abcba5cb8116f
Parent: 68ef288901820b522e3765e5fbec972ea348e3b7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 23 14:15:04 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 23 14:15:04 2013 +0200
test: new test new fail
Do not hide new features into old test files.
---
test/shell/lvchange-partial-raid10.sh | 29 +++++++++++++++++++++++++++++
test/shell/lvchange-partial.sh | 12 ------------
2 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/test/shell/lvchange-partial-raid10.sh b/test/shell/lvchange-partial-raid10.sh
new file mode 100644
index 0000000..64a2389
--- /dev/null
+++ b/test/shell/lvchange-partial-raid10.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+# Copyright (C) 2013 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+aux target_at_least dm-raid 1 3 2 || skip
+
+aux prepare_vg 4
+
+# rhbz 889358
+# Should be able to activate when RAID10
+# has failed devs in different mirror sets.
+lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg
+aux wait_for_sync $vg $lv1
+lvchange -an $vg/$lv1
+aux disable_dev "$dev1" "$dev3"
+lvchange -ay $vg/$lv1 --partial
+lvchange -an $vg/$lv1
+
+aux enable_dev "$dev1"
+lvremove -ff $vg
diff --git a/test/shell/lvchange-partial.sh b/test/shell/lvchange-partial.sh
index bc9a514..891dd0a 100644
--- a/test/shell/lvchange-partial.sh
+++ b/test/shell/lvchange-partial.sh
@@ -66,15 +66,3 @@ not lvchange --resync --addtag foo $vg/$lv1
aux enable_dev "$dev1"
lvremove -ff $vg
-
-# rhbz 889358
-# Should be able to activate when RAID10
-# has failed devs in different mirror sets.
-if aux target_at_least dm-raid 1 3 2; then
- lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg
- aux wait_for_sync $vg $lv1
- lvchange -an $vg/$lv1
- aux disable_dev "$dev1" "$dev3"
- lvchange -ay $vg/$lv1 --partial
- lvchange -an $vg/$lv1
-fi
10 years, 12 months
master - raid: remove wrong pool free
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=68ef288901820b...
Commit: 68ef288901820b522e3765e5fbec972ea348e3b7
Parent: 1445d407949735c8fc17c9c0871d39224ef6d716
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 23 14:06:40 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 23 14:06:40 2013 +0200
raid: remove wrong pool free
No, we cannot free pool members here.
---
tools/lvchange.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index cc3e96b..796e512 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -266,25 +266,19 @@ static int detach_metadata_devices(struct lv_segment *seg, struct dm_list *list)
static int attach_metadata_devices(struct lv_segment *seg, struct dm_list *list)
{
struct cmd_context *cmd = seg->lv->vg->cmd;
- struct lv_list *lvl, *tmp;
+ struct lv_list *lvl;
if (seg_is_raid(seg)) {
- dm_list_iterate_items_safe(lvl, tmp, list) {
+ dm_list_iterate_items(lvl, list)
lv_set_hidden(lvl->lv);
- dm_pool_free(cmd->mem, lvl);
- }
return 1;
}
dm_list_iterate_items(lvl, list)
break; /* get first item */
- if (!attach_mirror_log(seg, lvl->lv)) {
- dm_pool_free(cmd->mem, lvl);
+ if (!attach_mirror_log(seg, lvl->lv))
return_0;
- }
-
- dm_pool_free(cmd->mem, lvl);
return 1;
}
10 years, 12 months
master - cleanup: type
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1445d407949735...
Commit: 1445d407949735c8fc17c9c0871d39224ef6d716
Parent: 45eeb70b02df0f196ccd851c23c42fc29d6efb39
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 23 12:35:10 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 23 12:35:10 2013 +0200
cleanup: type
oops another type inserted.
---
lib/config/config.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 0af57d5..2fd8793 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -65,7 +65,7 @@ struct dm_config_tree *config_file_open(const char *filename, int keep_open)
return NULL;
if (!(cf = dm_pool_zalloc(cft->mem, sizeof(struct config_file)))) {
- log_error("Failed to allocate condig tree.");
+ log_error("Failed to allocate config tree.");
goto fail;
}
10 years, 12 months
master - config: merge timestamps
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=45eeb70b02df0f...
Commit: 45eeb70b02df0f196ccd851c23c42fc29d6efb39
Parent: 2925023411ff9c7a32fa7660617c94a9d9dcd653
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 23 12:24:17 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 23 12:31:16 2013 +0200
config: merge timestamps
Merging multiple config files together needs to know newest (highest)
timestamp of merged files. Persistent cache file is being used
only in case, the config file is older then .cache file.
---
WHATS_NEW | 1 +
lib/config/config.c | 11 +++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c1324de..4139557 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Find newest timestamp of merged config files.
Fix assignment order for vg fid for lvm1 and pool format.
Fix memleak in dmeventd thin plugin in device list obtaining err path.
Add explicit message about unsupported pvmove for thin/thinpool volumes.
diff --git a/lib/config/config.c b/lib/config/config.c
index e999fc6..0af57d5 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -768,6 +768,7 @@ int merge_config_tree(struct cmd_context *cmd, struct dm_config_tree *cft,
struct dm_config_node *root = cft->root;
struct dm_config_node *cn, *nextn, *oldn, *cn2;
const struct dm_config_node *tn;
+ struct config_file *cf, *cfn;
for (cn = newdata->root; cn; cn = nextn) {
nextn = cn->sib;
@@ -797,6 +798,16 @@ int merge_config_tree(struct cmd_context *cmd, struct dm_config_tree *cft,
_merge_section(oldn, cn);
}
+ /*
+ * Persistent filter loading is based on timestamp,
+ * so we need to know the newest timestamp to make right decision
+ * whether the .cache isn't older then any of configs
+ */
+ if ((cf = dm_config_get_custom(cft)) &&
+ (cfn = dm_config_get_custom(newdata)) &&
+ cf->timestamp < cfn->timestamp)
+ cf->timestamp = cfn->timestamp;
+
return 1;
}
10 years, 12 months
master - cleanup: improve messages
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2925023411ff9c...
Commit: 2925023411ff9c7a32fa7660617c94a9d9dcd653
Parent: 35ab841ecff4a887e70b54b1afb01dd42a4e9cd6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 23 11:58:50 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 23 12:27:33 2013 +0200
cleanup: improve messages
Add verbose message when we will not obtain devices from udev
(i.e. testing is using different udev dir, and the log was
giving misleading info about using udev)
Add proper error message if zalloc from pull would have failed.
Fix typo obolete -> obsolete
---
lib/commands/toolcontext.c | 3 +++
lib/config/config.c | 6 ++++--
lib/filters/filter-persistent.c | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index c42a0bf..8f06285 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -777,6 +777,9 @@ static int _init_dev_cache(struct cmd_context *cmd)
udev_dir_len != len;
if (len_diff || strncmp(DM_UDEV_DEV_DIR, cv->v.str, len)) {
+ log_very_verbose("Non standard udev dir %s, resetting "
+ "devices/obtain_device_list_from_udev.",
+ cv->v.str);
device_list_from_udev = 0;
init_obtain_device_list_from_udev(0);
}
diff --git a/lib/config/config.c b/lib/config/config.c
index ad02f5f..e999fc6 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -64,8 +64,10 @@ struct dm_config_tree *config_file_open(const char *filename, int keep_open)
if (!cft)
return NULL;
- cf = dm_pool_zalloc(cft->mem, sizeof(struct config_file));
- if (!cf) goto fail;
+ if (!(cf = dm_pool_zalloc(cft->mem, sizeof(struct config_file)))) {
+ log_error("Failed to allocate condig tree.");
+ goto fail;
+ }
cf->keep_open = keep_open;
dm_config_set_custom(cft, cf);
diff --git a/lib/filters/filter-persistent.c b/lib/filters/filter-persistent.c
index bec396b..0d53fce 100644
--- a/lib/filters/filter-persistent.c
+++ b/lib/filters/filter-persistent.c
@@ -103,8 +103,8 @@ int persistent_filter_load(struct dev_filter *f, struct dm_config_tree **cft_out
if (obtain_device_list_from_udev()) {
if (!stat(pf->file, &info)) {
- log_very_verbose("Obtaining device list from "
- "udev. Removing obolete %s.",
+ log_very_verbose("Obtaining device list from udev. "
+ "Removing obsolete %s.",
pf->file);
if (unlink(pf->file) < 0 && errno != EROFS)
log_sys_error("unlink", pf->file);
10 years, 12 months
master - cleanup: drop zeroing of zallocated data
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=35ab841ecff4a8...
Commit: 35ab841ecff4a887e70b54b1afb01dd42a4e9cd6
Parent: a12f92c494a60fe6e6c9e133aa879bd0d0da069a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 23 11:52:17 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 23 12:27:33 2013 +0200
cleanup: drop zeroing of zallocated data
---
lib/config/config.c | 2 --
libdm/libdm-config.c | 4 +---
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 8acb87d..ad02f5f 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -67,8 +67,6 @@ struct dm_config_tree *config_file_open(const char *filename, int keep_open)
cf = dm_pool_zalloc(cft->mem, sizeof(struct config_file));
if (!cf) goto fail;
- cf->timestamp = 0;
- cf->exists = 0;
cf->keep_open = keep_open;
dm_config_set_custom(cft, cf);
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 368f9e3..dfd9174 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -105,10 +105,8 @@ struct dm_config_tree *dm_config_create(void)
dm_pool_destroy(mem);
return 0;
}
- cft->root = NULL;
- cft->cascade = NULL;
- cft->custom = NULL;
cft->mem = mem;
+
return cft;
}
10 years, 12 months
master - format1: add workaround for vg_set_fid
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a12f92c494a60f...
Commit: a12f92c494a60fe6e6c9e133aa879bd0d0da069a
Parent: 994c32272e7c36f45defda12848d3856590a0d1f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Apr 21 23:53:53 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Apr 21 23:53:53 2013 +0200
format1: add workaround for vg_set_fid
Since we want to set fid just before return of vg,
add this termporary workaround.
---
lib/format1/format1.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lib/format1/format1.c b/lib/format1/format1.c
index 2864227..115f8d1 100644
--- a/lib/format1/format1.c
+++ b/lib/format1/format1.c
@@ -217,8 +217,13 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid,
if (!import_extents(fid->fmt->cmd, vg, &pvs))
goto_bad;
- if (!import_snapshots(vg->vgmem, vg, &pvs))
+ /* FIXME: workaround - temporary assignment of fid */
+ vg->fid = fid;
+ if (!import_snapshots(vg->vgmem, vg, &pvs)) {
+ vg->fid = NULL;
goto_bad;
+ }
+ vg->fid = NULL;
/* Fix extents counts by adding missing PV if partial VG */
if ((vg->status & PARTIAL_VG) && !_fix_partial_vg(vg, &pvs))
11 years
master - test: singlenode minor cleanups
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=994c32272e7c36...
Commit: 994c32272e7c36f45defda12848d3856590a0d1f
Parent: 9cdcde494f2824dbf8e549638331ab65b1f56b3a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 18 18:01:52 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Apr 21 23:15:07 2013 +0200
test: singlenode minor cleanups
Move unnecessary code out of locks.
---
daemons/clvmd/clvmd-singlenode.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemons/clvmd/clvmd-singlenode.c b/daemons/clvmd/clvmd-singlenode.c
index b968c5f..a79100f 100644
--- a/daemons/clvmd/clvmd-singlenode.c
+++ b/daemons/clvmd/clvmd-singlenode.c
@@ -218,8 +218,8 @@ maybe_retry:
goto retry;
}
bad:
- DEBUGLOG("Failed to lock resource %s\n", resource);
pthread_mutex_unlock(&_lock_mutex);
+ DEBUGLOG("Failed to lock resource %s\n", resource);
return 1; /* fail */
}
@@ -251,9 +251,9 @@ static int _unlock_resource(const char *resource, int lockid)
}
dm_hash_remove(_locks, resource);
- dm_free(lck);
pthread_cond_broadcast(&_lock_cond); /* wakeup waiters */
pthread_mutex_unlock(&_lock_mutex);
+ dm_free(lck);
return 0;
}
@@ -312,6 +312,6 @@ struct cluster_ops *init_singlenode_cluster(void)
{
if (!_init_cluster())
return &_cluster_singlenode_ops;
- else
- return NULL;
+
+ return NULL;
}
11 years
master - cleanup: drop unwanted ';'
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9cdcde494f2824...
Commit: 9cdcde494f2824dbf8e549638331ab65b1f56b3a
Parent: 5a751ad703c8082aaf96c53fc1e76bd8fc607235
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Apr 21 22:32:43 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Apr 21 23:15:07 2013 +0200
cleanup: drop unwanted ';'
---
daemons/clvmd/clvmd.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemons/clvmd/clvmd.h b/daemons/clvmd/clvmd.h
index 67ea41e..fb0589d 100644
--- a/daemons/clvmd/clvmd.h
+++ b/daemons/clvmd/clvmd.h
@@ -95,7 +95,7 @@ struct local_client {
} bits;
};
-#define DEBUGLOG(fmt, args...) debuglog(fmt, ## args);
+#define DEBUGLOG(fmt, args...) debuglog(fmt, ## args)
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
11 years