master - select: fix string list selection to match whole words only but not prefixes of searched string
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6dd98c1fa89abb...
Commit: 6dd98c1fa89abb8ee9b91504a73d3a1c3f10e6d4
Parent: 9738a02d3d56a3a30bd8b59838eae8f805ba3bcc
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Aug 13 15:27:00 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Aug 13 16:04:02 2014 +0200
select: fix string list selection to match whole words only but not prefixes of searched string
$ lvs -o name,tags vg/lvol0
LV LV Tags
lvol0 a
Before this patch:
$ lvs -o name,tags vg/lvol0 -S 'tags=[a]'
LV LV Tags
lvol0 a
$ lvs -o name,tags vg/lvol0 -S 'tags=[ab]'
LV LV Tags
lvol0 a
(incorrect!)
$ lvs -o name,tags vg/lvol0 -S 'tags=[abc]'
LV LV Tags
lvol0 a
(incorrect!)
With this patch applied:
$ lvs -o name,tags vg/lvol0 -S 'tags=[a]'
LV LV Tags
lvol0 a
$ lvs -o name,tags vg/lvol0 -S 'tags=[ab]'
(no result - correct!)
$ lvs -o name,tags vg/lvol0 -S 'tags=[abc]'
(no result - correct!)
---
WHATS_NEW_DM | 1 +
libdm/libdm-report.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 842ee15..7bb3f4c 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.89 -
=================================
+ Fix string list selection to match whole words only, not prefixes.
Version 1.02.88 - 5th August 2014
=================================
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index b94cc00..620283c 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -1260,7 +1260,8 @@ static int _cmp_field_string_list_all(const struct str_list_sort_value *val,
/* both lists are sorted so they either match 1:1 or not */
dm_list_iterate_items(sel_item, sel->list) {
- if (strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
+ if ((strlen(sel_item->str) != val->items[i].len) ||
+ strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
return 0;
i++;
}
@@ -1285,7 +1286,8 @@ static int _cmp_field_string_list_any(const struct str_list_sort_value *val,
* Make use of the fact that the lists are sorted!
*/
for (i = 1; i <= val->items[0].len; i++) {
- if (!strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
+ if ((strlen(sel_item->str) == val->items[i].len) &&
+ !strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
return 1;
}
}
9 years, 8 months
master - filter-mpath: fix primary device lookup failure for partition when processing mpath filter
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9738a02d3d56a3...
Commit: 9738a02d3d56a3a30bd8b59838eae8f805ba3bcc
Parent: c52c9a1e316b6a92a2475dfe3ad2aac92edc80c0
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Aug 8 10:49:19 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Aug 8 10:49:19 2014 +0200
filter-mpath: fix primary device lookup failure for partition when processing mpath filter
If using persistent filter and we're refreshing filters (just like we
do for pvcreate now after commit 54685c20fc9dfb155a2e5bc9d8cf5f0aad944305),
we can't rely on getting the primary device of the partition from the cache
as such device could be already filtered by persistent filter and we get
a device cache lookup failure for such device.
For example:
$ lvm dumpconfig --type diff
devices {
obtain_device_list_from_udev=0
}
$lsblk /dev/sda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 128M 0 disk
`-sda1 8:1 0 127M 0 part
$cat /etc/lvm/cache/.cache | grep sda
"/dev/sda1",
$pvcreate /dev/sda1
dev_is_mpath: failed to get device for 8:1
Physical volume "/dev/sda1" successfully created
The problematic part of the code called dev_cache_get_by_devt
to get the device for the device number supplied. Then the code
used dev_name(dev) to get the name which is then used in check
whether there's any mpath on top of this dev...
This patch uses sysfs to get the base name for the partition
instead, hence avoiding the device cache which is a correct
approach here.
---
WHATS_NEW | 1 +
lib/filters/filter-mpath.c | 53 +++++++++++++++++++++++++++++---------------
2 files changed, 36 insertions(+), 18 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 96ce8cb..28f7e36 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.110 -
==================================
+ Fix primary device lookup failure for partition when processing mpath filter.
If LV inactive and non-clustered, do not issue "Cannot deactivate" on -aln.
Remove spurious "Skipping mirror LV" message on pvmove of clustered mirror.
diff --git a/lib/filters/filter-mpath.c b/lib/filters/filter-mpath.c
index 10106f0..52c9341 100644
--- a/lib/filters/filter-mpath.c
+++ b/lib/filters/filter-mpath.c
@@ -40,6 +40,34 @@ static const char *get_sysfs_name(struct device *dev)
return name;
}
+static const char *get_sysfs_name_by_devt(const char *sysfs_dir, dev_t devno,
+ char *buf, size_t buf_size)
+{
+ const char *name;
+ char path[PATH_MAX];
+ int size;
+
+ if (dm_snprintf(path, sizeof(path), "%s/dev/block/%d:%d", sysfs_dir,
+ (int) MAJOR(devno), (int) MINOR(devno)) < 0) {
+ log_error("Sysfs path string is too long.");
+ return NULL;
+ }
+
+ if ((size = readlink(path, buf, buf_size - 1)) < 0) {
+ log_sys_error("readlink", path);
+ return NULL;
+ }
+ buf[size] = '\0';
+
+ if (!(name = strrchr(buf, '/'))) {
+ log_error("Cannot find device name in sysfs path.");
+ return NULL;
+ }
+ name++;
+
+ return name;
+}
+
static int get_sysfs_string(const char *path, char *buffer, int max_size)
{
FILE *fp;
@@ -116,7 +144,7 @@ static int get_parent_mpath(const char *dir, char *name, int max_size)
static int dev_is_mpath(struct dev_filter *f, struct device *dev)
{
struct dev_types *dt = (struct dev_types *) f->private;
- const char *name;
+ const char *part_name, *name;
char path[PATH_MAX+1];
char parent_name[PATH_MAX+1];
struct stat info;
@@ -136,31 +164,20 @@ static int dev_is_mpath(struct dev_filter *f, struct device *dev)
return 0;
case 1:
/* The dev is already a primary dev. Just continue with the dev. */
+ if (!(name = get_sysfs_name(dev)))
+ return_0;
break;
case 2:
/* The dev is partition. */
- name = dev_name(dev); /* name of original dev for log_debug msg */
-
- /* Get primary dev from cache. */
- if (!(dev = dev_cache_get_by_devt(primary_dev, NULL))) {
- log_error("dev_is_mpath: failed to get device for %d:%d",
- major, minor);
- return 0;
- }
-
- major = (int) MAJOR(primary_dev);
- minor = (int) MINOR(primary_dev);
-
+ part_name = dev_name(dev); /* name of original dev for log_debug msg */
+ if (!(name = get_sysfs_name_by_devt(sysfs_dir, primary_dev, parent_name, PATH_MAX)))
+ return_0;
log_debug_devs("%s: Device is a partition, using primary "
"device %s for mpath component detection",
- name, dev_name(dev));
-
+ part_name, name);
break;
}
- if (!(name = get_sysfs_name(dev)))
- return_0;
-
if (dm_snprintf(path, PATH_MAX, "%s/block/%s/holders", sysfs_dir, name) < 0) {
log_error("Sysfs path to check mpath is too long.");
return 0;
9 years, 8 months
master - activation: if LV inactive and non-clustered, do not issue "Cannot deactivate" on -aln
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c52c9a1e316b6a...
Commit: c52c9a1e316b6a92a2475dfe3ad2aac92edc80c0
Parent: ea662ca06065d1e3d44814b54cf8501c9bb9594f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Aug 7 16:44:09 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Aug 7 16:44:09 2014 +0200
activation: if LV inactive and non-clustered, do not issue "Cannot deactivate" on -aln
The message "Cannot deactivate remotely exclusive device locally." makes
sense only for clustered LV. If the LV is non-clustered, then it's
always exclusive by definition and if it's already deactivated, this
message pops up inappropriately as those two conditions are met.
So issue the message only if the conditions are met AND we have clustered VG.
---
WHATS_NEW | 1 +
lib/metadata/lv.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 028758e..96ce8cb 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.110 -
==================================
+ If LV inactive and non-clustered, do not issue "Cannot deactivate" on -aln.
Remove spurious "Skipping mirror LV" message on pvmove of clustered mirror.
Version 2.02.109 - 5th August 2014
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index f2c9b12..9539369 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -859,7 +859,7 @@ deactivate:
return_0;
break;
case CHANGE_ALN:
- if (_lv_is_exclusive(lv)) {
+ if (vg_is_clustered(lv->vg) && _lv_is_exclusive(lv)) {
if (!lv_is_active_locally(lv)) {
log_error("Cannot deactivate remotely exclusive device locally.");
return 0;
9 years, 8 months
master - pvmove: remove spurious "Skipping mirror LV" message on pvmove of clustered mirror
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ea662ca06065d1...
Commit: ea662ca06065d1e3d44814b54cf8501c9bb9594f
Parent: 26885ea119891294961939f8e3f73eee8163ad08
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Aug 7 15:23:58 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Aug 7 15:23:58 2014 +0200
pvmove: remove spurious "Skipping mirror LV" message on pvmove of clustered mirror
With cmirrord, we can do pvmove of clustered mirror. The code checking
suitability of LVs on the PV being moved issued a message if a mirror
LV was found and the VG was clustered. However, the actual pvmove did
work correctly.
The top-level mirror LV is actually skipped in the code since it's
always layered on top of internal LVs making up the mirror LV and for pvmove
we consider these internal devices only as they're actually layered on
top of concrete PVs then. But we don't need to issue any message here
about skipping the top-level mirror LV - it's misleading here.
---
WHATS_NEW | 1 +
tools/pvmove.c | 22 ++++++++++------------
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index afefd6e..028758e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.110 -
==================================
+ Remove spurious "Skipping mirror LV" message on pvmove of clustered mirror.
Version 2.02.109 - 5th August 2014
==================================
diff --git a/tools/pvmove.c b/tools/pvmove.c
index c4c590b..3448af4 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -319,12 +319,15 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
continue;
/*
- * RAID, thin, mirror, and snapshot-related LVs are not
- * processed in a cluster, so we don't have to worry about
- * avoiding certain PVs in that context.
+ * RAID, thin and snapshot-related LVs are not
+ * processed in a cluster, so we don't have to
+ * worry about avoiding certain PVs in that context.
*/
- if (vg_is_clustered(lv->vg))
- continue;
+ if (vg_is_clustered(lv->vg)) {
+ /* Allow clustered mirror, but not raid mirror. */
+ if (!lv_is_mirror_type(lv) || lv_is_raid(lv))
+ continue;
+ }
if (!lv_is_on_pvs(lv, source_pvl))
continue;
@@ -391,8 +394,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
*/
if (vg_is_clustered(vg) &&
(lv_is_origin(lv) || lv_is_cow(lv) ||
- lv_is_thin_type(lv) || lv_is_raid_type(lv) ||
- lv_is_mirrored(lv))) {
+ lv_is_thin_type(lv) || lv_is_raid_type(lv))) {
log_print_unless_silent("Skipping %s LV %s",
lv_is_origin(lv) ? "origin" :
lv_is_cow(lv) ?
@@ -405,11 +407,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
seg_is_raid(first_seg(lv)) ?
"RAID" :
lv_is_raid_type(lv) ?
- "RAID-related" :
- lv_is_mirrored(lv) ?
- "mirror" :
- lv_is_mirror_type(lv) ?
- "mirror-related" : "",
+ "RAID-related" : "",
lv->name);
lv_skipped = 1;
continue;
9 years, 8 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=26885ea1198912...
Commit: 26885ea119891294961939f8e3f73eee8163ad08
Parent: 9d4e1e51a944c07bad56fe41407b84afefb39357
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 5 02:12:20 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 5 02:12:20 2014 +0100
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 2eb161b..81e874b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.109(2)-git (2014-08-05)
+2.02.110(2)-git (2014-08-05)
diff --git a/VERSION_DM b/VERSION_DM
index e9787c1..f2b3ee8 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.88-git (2014-08-05)
+1.02.89-git (2014-08-05)
diff --git a/WHATS_NEW b/WHATS_NEW
index e63a3e8..afefd6e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.110 -
+==================================
+
Version 2.02.109 - 5th August 2014
==================================
Remove lv_volume_type field from reports. (2.02.108)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 7b19ea1..842ee15 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.89 -
+=================================
+
Version 1.02.88 - 5th August 2014
=================================
Add dm_tree_set_optional_uuid_suffixes to handle upgrades.
9 years, 8 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9d4e1e51a944c0...
Commit: 9d4e1e51a944c07bad56fe41407b84afefb39357
Parent: e94442bffa26d51a67b0102daac4d9f755fe5343
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 5 02:07:35 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 5 02:07:35 2014 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 7 ++++---
WHATS_NEW_DM | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index 79c463f..2eb161b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.109(2)-git (2014-07-23)
+2.02.109(2)-git (2014-08-05)
diff --git a/VERSION_DM b/VERSION_DM
index a6ea805..e9787c1 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.88-git (2014-07-23)
+1.02.88-git (2014-08-05)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8397d30..e63a3e8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
-Version 2.02.109 -
-=================================
- Fix a segfault in lvscan --cache when devices were already missing.
+Version 2.02.109 - 5th August 2014
+==================================
+ Remove lv_volume_type field from reports. (2.02.108)
+ Fix a segfault in lvscan --cache when devices were already missing. (2.02.108)
Fix incorrect persistent .cache after vgcreate with PV creation. (2.02.108)
Display actual size changed when resizing LV.
Allow approximate allocation with +%FREE in lvextend.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index b663bfc..7b19ea1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.88 -
-================================
+Version 1.02.88 - 5th August 2014
+=================================
Add dm_tree_set_optional_uuid_suffixes to handle upgrades.
Version 1.02.87 - 23rd July 2014
9 years, 8 months
master - report: Remove lv_volume_type field.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e94442bffa26d5...
Commit: e94442bffa26d51a67b0102daac4d9f755fe5343
Parent: 2dac5525fb39f83a8088c10ae6c9bc0131a01433
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 5 02:04:16 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 5 02:04:16 2014 +0100
report: Remove lv_volume_type field.
Like lv_target_type, this field needs reworking.
---
lib/report/columns.h | 2 +-
lib/report/properties.c | 4 ++--
lib/report/report.c | 2 ++
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 0d95806..1761a6d 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -39,7 +39,7 @@ FIELD(LVS, lv, STR, "Path", lvid, 4, lvpath, lv_path, "Full pathname for LV. Bla
FIELD(LVS, lv, STR, "DMPath", lvid, 6, lvdmpath, lv_dm_path, "Internal device-mapper pathname for LV (in /dev/mapper directory).", 0)
FIELD(LVS, lv, STR, "Parent", lvid, 6, lvparent, lv_parent, "For LVs that are components of another LV, the parent LV.", 0)
FIELD(LVS, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0)
-FIELD(LVS, lv, STR, "Type", lvid, 10, lvvolumetype, lv_volume_type, "LV volume type.", 0)
+//FIELD(LVS, lv, STR, "Type", lvid, 10, lvvolumetype, lv_volume_type, "LV volume type.", 0)
FIELD(LVS, lv, BIN, "InitImgSync", lvid, 10, lvinitialimagesync, lv_initial_image_sync, "Set if mirror/RAID images underwent initial resynchronization.", 0)
FIELD(LVS, lv, BIN, "ImgSynced", lvid, 10, lvimagesynced, lv_image_synced, "Set if mirror/RAID image is synchronized.", 0)
FIELD(LVS, lv, BIN, "Merging", lvid, 10, lvmerging, lv_merging, "Set if snapshot LV is being merged to origin.", 0)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index 72d689d..3be44f2 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -179,8 +179,8 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
#define _vg_clustered_set prop_not_implemented_set
#define _vg_clustered_get prop_not_implemented_get
-#define _lv_volume_type_set prop_not_implemented_set
-#define _lv_volume_type_get prop_not_implemented_get
+//#define _lv_volume_type_set prop_not_implemented_set
+//#define _lv_volume_type_get prop_not_implemented_get
#define _lv_initial_image_sync_set prop_not_implemented_set
#define _lv_initial_image_sync_get prop_not_implemented_get
#define _lv_image_synced_get prop_not_implemented_get
diff --git a/lib/report/report.c b/lib/report/report.c
index cea2c3c..842a1a5 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1318,6 +1318,7 @@ static int _vgclustered_disp(struct dm_report *rh, struct dm_pool *mem,
return _binary_disp(rh, mem, field, clustered, FIRST_NAME(vg_clustered_y), private);
}
+/* FIXME Replace with something that provides a complete unique description for every combination.
static int _lvvolumetype_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
@@ -1325,6 +1326,7 @@ static int _lvvolumetype_disp(struct dm_report *rh, struct dm_pool *mem,
const char *type = lv_type_name((const struct logical_volume *) data);
return _string_disp(rh, mem, field, &type, private);
}
+*/
static int _lvinitialimagesync_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
9 years, 8 months
master - lvscan: Fix possible gcc warnings in --cache implementation.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2dac5525fb39f8...
Commit: 2dac5525fb39f83a8088c10ae6c9bc0131a01433
Parent: 46262f163b2a6c802f91076c2675bda4be5d8a2d
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Aug 4 17:36:12 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Mon Aug 4 17:36:12 2014 +0200
lvscan: Fix possible gcc warnings in --cache implementation.
---
tools/lvscan.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/lvscan.c b/tools/lvscan.c
index 0cfbe83..487c4cf 100644
--- a/tools/lvscan.c
+++ b/tools/lvscan.c
@@ -18,20 +18,20 @@
static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct logical_volume *lv)
{
struct pv_list *pvl;
- struct dm_list pvs;
- char pvid_s[64];
+ struct dm_list all_pvs;
+ char pvid_s[64] __attribute__((aligned(8)));
if (!lvmetad_used()) {
log_verbose("Ignoring lvscan --cache because lvmetad is not in use.");
return ECMD_PROCESSED;
}
- dm_list_init(&pvs);
+ dm_list_init(&all_pvs);
- if (!get_pv_list_for_lv(lv->vg->vgmem, lv, &pvs))
+ if (!get_pv_list_for_lv(lv->vg->vgmem, lv, &all_pvs))
return ECMD_FAILED;
- dm_list_iterate_items(pvl, &pvs) {
+ dm_list_iterate_items(pvl, &all_pvs) {
if (!pvl->pv->dev) {
id_write_format(&pvl->pv->id, pvid_s, sizeof(pvid_s));
log_warn("WARNING: Device for PV %s already missing, skipping.",
9 years, 8 months
master - WHATS_NEW: lvscan --cache SEGV fix
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=46262f163b2a6c...
Commit: 46262f163b2a6c802f91076c2675bda4be5d8a2d
Parent: 0208665209c4e8f02841a426e6073a48195f56c1
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Aug 4 17:05:08 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Mon Aug 4 17:05:08 2014 +0200
WHATS_NEW: lvscan --cache SEGV fix
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index ff30039..8397d30 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.109 -
=================================
+ Fix a segfault in lvscan --cache when devices were already missing.
Fix incorrect persistent .cache after vgcreate with PV creation. (2.02.108)
Display actual size changed when resizing LV.
Allow approximate allocation with +%FREE in lvextend.
9 years, 8 months
master - lvscan: Make --cache impervious to already-missing devices.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0208665209c4e8...
Commit: 0208665209c4e8f02841a426e6073a48195f56c1
Parent: 03a88da86895f4700edf77af4efde62a30e67bff
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Aug 4 17:02:26 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Mon Aug 4 17:03:17 2014 +0200
lvscan: Make --cache impervious to already-missing devices.
---
tools/lvscan.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/tools/lvscan.c b/tools/lvscan.c
index df8a12e..0cfbe83 100644
--- a/tools/lvscan.c
+++ b/tools/lvscan.c
@@ -19,6 +19,7 @@ static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct logical_volume
{
struct pv_list *pvl;
struct dm_list pvs;
+ char pvid_s[64];
if (!lvmetad_used()) {
log_verbose("Ignoring lvscan --cache because lvmetad is not in use.");
@@ -30,9 +31,16 @@ static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct logical_volume
if (!get_pv_list_for_lv(lv->vg->vgmem, lv, &pvs))
return ECMD_FAILED;
- dm_list_iterate_items(pvl, &pvs)
+ dm_list_iterate_items(pvl, &pvs) {
+ if (!pvl->pv->dev) {
+ id_write_format(&pvl->pv->id, pvid_s, sizeof(pvid_s));
+ log_warn("WARNING: Device for PV %s already missing, skipping.",
+ pvid_s);
+ continue;
+ }
if (!lvmetad_pvscan_single(cmd, pvl->pv->dev, NULL))
return ECMD_FAILED;
+ }
return ECMD_PROCESSED;
}
9 years, 8 months