master - raid: fix validation check for raid0 aegment data_offset member
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=85604c0bf10e1454742...
Commit: 85604c0bf10e14547427c428d7b8cb3f57cdbeac
Parent: 5f13e33d541f7af77f586ac55edfed336ad8dcc1
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Oct 9 15:21:51 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Oct 9 15:21:51 2017 +0200
raid: fix validation check for raid0 aegment data_offset member
Commit 2f754b73ffdaa95af4a6d703e31b76d4efbf7a36 missed one.
---
lib/metadata/merge.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c
index 5017cf1..711e7e7 100644
--- a/lib/metadata/merge.c
+++ b/lib/metadata/merge.c
@@ -119,7 +119,7 @@ static void _check_raid0_seg(struct lv_segment *seg, int *error_count)
raid_seg_error_val("non-zero min recovery rate", seg->min_recovery_rate);
if (seg->max_recovery_rate)
raid_seg_error_val("non-zero max recovery rate", seg->max_recovery_rate);
- if ((seg->lv->status & LV_RESHAPE_DATA_OFFSET) || seg->data_offset)
+ if ((seg->lv->status & LV_RESHAPE_DATA_OFFSET) || seg->data_offset > 1)
raid_seg_error_val("data_offset", seg->data_offset);
}
6 years, 6 months
master - lvcreate: fix region size on striped RaidLVs
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5f13e33d541f7af77f5...
Commit: 5f13e33d541f7af77f586ac55edfed336ad8dcc1
Parent: 2f754b73ffdaa95af4a6d703e31b76d4efbf7a36
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Oct 9 14:34:10 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Oct 9 14:35:06 2017 +0200
lvcreate: fix region size on striped RaidLVs
Creating striped RaidLVs with lv size not divisible by region size
caused the region size to be adjusted:
# lvcreate --type raid5 -n region_check.32.00m_3 -i 3 -L 1g --nosync -R 32.00m raid_sanity
Using default stripesize 64.00 KiB.
Rounding size 1.00 GiB (256 extents) up to stripe boundary size <1.01 GiB(258 extents).
WARNING: New raid5 won't be synchronised. Don't read what you didn't write!
Using reduced mirror region size of 8.00 MiB
Logical volume region_check.32.00m_3 created.
Fix by not imposing "mirror" constraints on "raid".
Resolves: rhbz1404007
---
lib/metadata/lv_manip.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 1851783..719fcba 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7536,11 +7536,18 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
status |= LV_NOTSYNCED;
}
- lp->region_size = adjusted_mirror_region_size(vg->cmd,
- vg->extent_size,
- lp->extents,
- lp->region_size, 0,
- vg_is_clustered(vg));
+ if (seg_is_raid(lp)) {
+ /* Value raid target constraint */
+ if (lp->region_size > (uint64_t)vg->extent_size * lp->extents) {
+ log_error("Cannot create RAID LV with region size larger than LV size.");
+ return NULL;
+ }
+ } else
+ lp->region_size = adjusted_mirror_region_size(vg->cmd,
+ vg->extent_size,
+ lp->extents,
+ lp->region_size, 0,
+ vg_is_clustered(vg));
} else if (pool_lv && seg_is_thin_volume(lp)) {
if (!lv_is_thin_pool(pool_lv)) {
log_error("Logical volume %s is not a thin pool.",
6 years, 6 months
master - raid: fix validation checks for segment data_offset member
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2f754b73ffdaa95af4a...
Commit: 2f754b73ffdaa95af4a6d703e31b76d4efbf7a36
Parent: 554a761db2acf2216eadf0279a390ac924038286
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Oct 9 14:00:46 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Oct 9 14:01:23 2017 +0200
raid: fix validation checks for segment data_offset member
Commit 222e1e3acee399b0acf31565f784716d67c465a8 was not
valuing special case of data_ofset member equal to 1.
---
lib/metadata/merge.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c
index b0adc5a..5017cf1 100644
--- a/lib/metadata/merge.c
+++ b/lib/metadata/merge.c
@@ -143,7 +143,7 @@ static void _check_raid1_seg(struct lv_segment *seg, int *error_count)
raid_seg_error("no meta areas");
if (seg->stripe_size)
raid_seg_error_val("non-zero stripe size", seg->stripe_size);
- if ((seg->lv->status & LV_RESHAPE_DATA_OFFSET) || seg->data_offset)
+ if ((seg->lv->status & LV_RESHAPE_DATA_OFFSET) || seg->data_offset > 1)
raid_seg_error_val("data_offset", seg->data_offset);
_check_raid_region_recovery(seg, error_count);
}
@@ -170,7 +170,7 @@ static void _check_raid45610_seg(struct lv_segment *seg, int *error_count)
/* END: checks applying to any raid4/5/6/10 */
if (seg->lv->status & LV_RESHAPE_DATA_OFFSET) {
- if (seg->data_offset & (seg->lv->vg->extent_size - 1))
+ if (seg->data_offset > 1 && (seg->data_offset & (seg->lv->vg->extent_size - 1)))
raid_seg_error_val("data_offset", seg->data_offset);
} else if (seg->data_offset)
raid_seg_error_val("data_offset", seg->data_offset);
6 years, 6 months
master - raid: return previous reshape space allocation properly
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=554a761db2acf2216ea...
Commit: 554a761db2acf2216eadf0279a390ac924038286
Parent: f005a6e7922d9a95eadfbd433714c80301eba794
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Oct 9 13:53:27 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Oct 9 13:55:01 2017 +0200
raid: return previous reshape space allocation properly
Fix returning previous allocation of reshape space.
---
lib/metadata/raid_manip.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 885a1ca..691ff58 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1692,10 +1692,10 @@ static int _lv_alloc_reshape_space(struct logical_volume *lv,
static int _lv_free_reshape_space_with_status(struct logical_volume *lv, enum alloc_where *where_it_was)
{
uint32_t total_reshape_len;
+ enum alloc_where where;
struct lv_segment *seg = first_seg(lv);
if ((total_reshape_len = _reshape_len_per_lv(lv))) {
- enum alloc_where where;
/*
* raid10:
*
@@ -1743,9 +1743,11 @@ static int _lv_free_reshape_space_with_status(struct logical_volume *lv, enum al
return_0;
lv->status &= ~LV_RESHAPE_DATA_OFFSET;
+ } else
+ where = alloc_none;
- } else if (where_it_was)
- *where_it_was = alloc_none;
+ if (where_it_was)
+ *where_it_was = where;
lv->status &= ~LV_RESHAPE;
6 years, 6 months
master - man: regenerate
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f005a6e7922d9a95ead...
Commit: f005a6e7922d9a95eadfbd433714c80301eba794
Parent: a994fc5e50d2090dcf209f508696551ce0f5b35a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Oct 6 23:10:02 2017 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Oct 6 23:10:02 2017 +0100
man: regenerate
---
man/lvconvert.8_pregen | 10 ++++++++--
man/pvscan.8_pregen | 7 +++----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index 93a8b27..fb2d869 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -753,10 +753,12 @@ Merge COW snapshot LV into its origin.
Replace failed PVs in a raid or mirror LV.
.br
-Repair a thin pool.
+Repair a thin pool.
+.br
+Repair a cache pool.
.br
.P
-\fBlvconvert\fP \fB--repair\fP \fILV\fP\fI_thinpool_mirror_raid\fP
+\fBlvconvert\fP \fB--repair\fP \fILV\fP\fI_thinpool_cache_cachepool_mirror_raid\fP
.br
.RS 4
.ad l
@@ -767,6 +769,10 @@ Repair a thin pool.
[ \fB--usepolicies\fP ]
.ad b
.br
+.ad l
+[ \fB--poolmetadataspare\fP \fBy\fP|\fBn\fP ]
+.ad b
+.br
[ COMMON_OPTIONS ]
.RE
.br
diff --git a/man/pvscan.8_pregen b/man/pvscan.8_pregen
index 4927fcb..ebd155f 100644
--- a/man/pvscan.8_pregen
+++ b/man/pvscan.8_pregen
@@ -76,8 +76,7 @@ When event-driven system services detect a new LVM device, the first step
is to automatically scan and cache the metadata from the device. This is
done by pvscan --cache. A second step is to automatically activate LVs
that are present on the new device. This auto-activation is done by the
-same pvscan --cache command when the option '-a|--activate ay' is
-included.
+same pvscan --cache command when the option --activate ay is included.
Auto-activation of VGs or LVs can be enabled/disabled using:
.br
@@ -92,11 +91,11 @@ When this setting is undefined, all LVs are auto-activated (when lvm is
fully integrated with the event-driven system services.)
When a VG or LV is not auto-activated, traditional activation using
-vgchange or lvchange -a|--activate is needed.
+vgchange or lvchange --activate is needed.
.IP \[bu] 2
pvscan auto-activation can be only done in combination with --cache.
.IP \[bu] 2
-Auto-activation is designated by the "a" argument in '-a|--activate ay'.
+Auto-activation is designated by the "a" argument in --activate ay.
This is meant to distinguish system generated commands from explicit user
commands, although it can be used in any activation command. Whenever it
is used, the auto_activation_volume_list is applied.
6 years, 6 months
v2_02_175 annotated tag has been created
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=79177d1c89d99596d61...
Commit: 79177d1c89d99596d612e79e2b689336dd57cd26
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2017-10-06 21:12 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2017-10-06 21:12 +0000
annotated tag: v2_02_175 has been created
at 79177d1c89d99596d612e79e2b689336dd57cd26 (tag)
tagging 73b72b8331949a1af778ad34491de3c7663c107f (commit)
replaces v2_02_174
Release 2.02.175.
A small release with an assortment of fixes.
Also note that we do not intend to develop lvm2app or the python bindings any
further, and would like any users to move towards the D-Bus interface.
(Reference: https://github.com/lvmteam/lvm2/issues/1 )
48 files changed, 712 insertions(+), 194 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlnX8qcACgkQIoGRwVZ+LBfDMwCfVMlyP3W3510chWCuDHzCjmED
McoAni9FgeEsWxBxupz3b/G7/1dCRLjs
=KwpA
-----END PGP SIGNATURE-----
Alasdair G Kergon (5):
kernel: Refresh dm-ioctl.h
dmsetup: Process -S to filter input device lists.
vgsplit: Fix intermediate metadata corruption.
vgmerge: Fix intermediate metadata corruption
pre-release
David Teigland (7):
revert tidy: prefer not using else after return
lvcreate: use cmd defs to deny unspported lockd cases
man pvscan: just write --activate in description
toollib: fix parentheses in assignment + comparison
lvmlockd: activate mirror LVs in shared mode with cmirrord
pvmove: require LV name in a shared VG
improve error messages when command rules fail
Heinz Mauelshagen (1):
raid: enhance conversion rejection message
Marian Csontos (5):
liblvm: Deprecate library and bindings
liblvm: Add deprecation warning to configure
configure: Update configure
configure: Add warning for D-Bus w/o notifications
pvmove: Change error message
Peter Rajnoha (6):
blkdeactivate: fix --{dm,lvm,mpath}options option name recognition
blkdeactivate: fix blkdeactivate regression with failing DM/MD devs deactivation
blkdeactivate: add blkdeactivate -r wait option to wait for MD resync/recovery/reshape
blk-availability: use blkdeactivate -r wait in blk-availability systemd service/initscript
blkdeactivate: also try to unmount /boot on blkdeactivate -u if on top of supported device
blkdeactivate: cleanup
Thomas Lamprecht (1):
dmeventd: ensure systemd service gets stopped on shutdown
Tony Asleson (6):
lvmdbusd: Fix hang in MThreadRunner
lvmdbusd: Ensure vg_uuid is present
lvmdbusd: Improve args comparison
lvmdbusd: Main thread exception logging
lvmdbusd: Give threads names
lvmdbusd: thread stacks dump support
Zdenek Kabelac (8):
lvconvert: repair supports poometadatespare switch
lvconvert: support repair of cache/cachepool
libdm: fix parentheses in assignment + comparison
tests: check for free space in test dir
tests: repair of cachepool
tests: use portable df output
dmeventd: schedule exit on break
fsadm: add --help
6 years, 6 months
master - post-release
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a994fc5e50d2090dcf2...
Commit: a994fc5e50d2090dcf209f508696551ce0f5b35a
Parent: 73b72b8331949a1af778ad34491de3c7663c107f
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Oct 6 22:16:58 2017 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Oct 6 22:16:58 2017 +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 9611e66..e6f3580 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.175(2)-git (2017-10-06)
+2.02.176(2)-git (2017-10-06)
diff --git a/VERSION_DM b/VERSION_DM
index c5894b6..cb4da47 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.144-git (2017-10-06)
+1.02.145-git (2017-10-06)
diff --git a/WHATS_NEW b/WHATS_NEW
index ded5335..7899365 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.176 -
+===================================
+
Version 2.02.175 - 6th October 2017
===================================
Use --help with blockdev when checking for --getsize64 support in fsadm.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index e8035d1..a5d24dd 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.145 -
+===================================
+
Version 1.02.144 - 6th October 2017
===================================
Schedule exit when received SIGTERM in dmeventd.
6 years, 6 months
master - pre-release
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=73b72b8331949a1af77...
Commit: 73b72b8331949a1af778ad34491de3c7663c107f
Parent: 486ed108481cfbe4336f0fa590cbae251188ecc6
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Oct 6 22:10:48 2017 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Oct 6 22:10:48 2017 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 9 +++++++--
WHATS_NEW_DM | 4 ++--
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index eda932e..9611e66 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.175(2)-git (2017-09-13)
+2.02.175(2)-git (2017-10-06)
diff --git a/VERSION_DM b/VERSION_DM
index 8a32c45..c5894b6 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.144-git (2017-09-13)
+1.02.144-git (2017-10-06)
diff --git a/WHATS_NEW b/WHATS_NEW
index bba813d..ded5335 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,12 +1,17 @@
-Version 2.02.175 -
-======================================
+Version 2.02.175 - 6th October 2017
+===================================
Use --help with blockdev when checking for --getsize64 support in fsadm.
+ Dump lvmdbusd debug information with SIGUSR1.
Fix metadata corruption in vgsplit and vgmerge intermediate states.
Add PV_MOVED_VG PV status flag to mark PVs moving between VGs.
+ Fix lvmdbus hang and recognise unknown VG correctly.
+ Improve error messages when command rules fail.
Require LV name with pvmove in a shared VG.
Allow shared active mirror LVs with lvmlockd, dlm, and cmirrord.
Support lvconvert --repair with cache and cachepool volumes.
lvconvert --repair respects --poolmetadataspare option.
+ Mark that we don't plan to develop liblvm2app and python bindings any further.
+ Fix thin pool creation in shared VG. (2.02.173)
Version 2.02.174 - 13th September 2017
======================================
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index ea01089..e8035d1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.144 -
-======================================
+Version 1.02.144 - 6th October 2017
+===================================
Schedule exit when received SIGTERM in dmeventd.
Also try to unmount /boot on blkdeactivate -u if on top of supported device.
Use blkdeactivate -r wait in blk-availability systemd service/initscript.
6 years, 6 months
master - vgmerge: Fix intermediate metadata corruption
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=486ed108481cfbe4336...
Commit: 486ed108481cfbe4336f0fa590cbae251188ecc6
Parent: a781b1c1788461595f382918bb1fc210d248d444
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Oct 6 02:12:42 2017 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Oct 6 02:20:45 2017 +0100
vgmerge: Fix intermediate metadata corruption
vgmerge suffers from a similar problem to the one fixed in commit
8146548d25e9104f0d530d943290d448c1994c0a ("vgsplit: Fix intermediate
metadata corruption.")
When merging, splitting or renaming VGs, use a new PV status flag
PV_MOVED_VG to mark the PVs that hold metadata with the old VG name and
use this to provide PV-level granularity instead of incorrectly assuming
all PVs in the VG are the same.
---
WHATS_NEW | 3 ++-
lib/format_text/flags.c | 1 +
lib/format_text/format-text.c | 15 +++++++++------
lib/metadata/metadata-exported.h | 3 ++-
lib/metadata/metadata.c | 6 ++++++
tools/vgmerge.c | 5 +++++
6 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0cdd398..bba813d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,7 +1,8 @@
Version 2.02.175 -
======================================
Use --help with blockdev when checking for --getsize64 support in fsadm.
- Fix metadata corruption in vgsplit intermediate state.
+ Fix metadata corruption in vgsplit and vgmerge intermediate states.
+ Add PV_MOVED_VG PV status flag to mark PVs moving between VGs.
Require LV name with pvmove in a shared VG.
Allow shared active mirror LVs with lvmlockd, dlm, and cmirrord.
Support lvconvert --repair with cache and cachepool volumes.
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index 156d542..51acc46 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -48,6 +48,7 @@ static const struct flag _pv_flags[] = {
{EXPORTED_VG, "EXPORTED", STATUS_FLAG},
{MISSING_PV, "MISSING", COMPATIBLE_FLAG},
{MISSING_PV, "MISSING", STATUS_FLAG},
+ {PV_MOVED_VG, NULL, 0},
{UNLABELLED_PV, NULL, 0},
{0, NULL, 0}
};
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index c359c8a..3e1ca19 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -609,14 +609,17 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
struct mda_header *mdah;
struct pv_list *pvl;
int r = 0;
- uint64_t new_wrap = 0, old_wrap = 0, new_end;
+ uint64_t new_wrap = 0, old_wrap = 0, new_end;
int found = 0;
int noprecommit = 0;
+ const char *old_vg_name = NULL;
/* Ignore any mda on a PV outside the VG. vgsplit relies on this */
dm_list_iterate_items(pvl, &vg->pvs) {
if (pvl->pv->dev == mdac->area.dev) {
found = 1;
+ if (pvl->pv->status & PV_MOVED_VG)
+ old_vg_name = vg->old_name;
break;
}
}
@@ -630,8 +633,7 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if (!(mdah = raw_read_mda_header(fid->fmt, &mdac->area)))
goto_out;
- rlocn = _find_vg_rlocn(&mdac->area, mdah,
- vg->old_name ? vg->old_name : vg->name, &noprecommit);
+ rlocn = _find_vg_rlocn(&mdac->area, mdah, old_vg_name ? : vg->name, &noprecommit);
mdac->rlocn.offset = _next_rlocn_offset(rlocn, mdah);
if (!fidtc->raw_metadata_buf &&
@@ -719,11 +721,14 @@ static int _vg_commit_raw_rlocn(struct format_instance *fid,
int r = 0;
int found = 0;
int noprecommit = 0;
+ const char *old_vg_name = NULL;
/* Ignore any mda on a PV outside the VG. vgsplit relies on this */
dm_list_iterate_items(pvl, &vg->pvs) {
if (pvl->pv->dev == mdac->area.dev) {
found = 1;
+ if (pvl->pv->status & PV_MOVED_VG)
+ old_vg_name = vg->old_name;
break;
}
}
@@ -734,9 +739,7 @@ static int _vg_commit_raw_rlocn(struct format_instance *fid,
if (!(mdah = raw_read_mda_header(fid->fmt, &mdac->area)))
goto_out;
- if (!(rlocn = _find_vg_rlocn(&mdac->area, mdah,
- vg->old_name ? vg->old_name : vg->name,
- &noprecommit))) {
+ if (!(rlocn = _find_vg_rlocn(&mdac->area, mdah, old_vg_name ? : vg->name, &noprecommit))) {
mdah->raw_locns[0].offset = 0;
mdah->raw_locns[0].size = 0;
mdah->raw_locns[0].checksum = 0;
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 92b38de..4a8c519 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -84,6 +84,7 @@
#define CONVERTING UINT64_C(0x0000000000400000) /* LV */
#define MISSING_PV UINT64_C(0x0000000000800000) /* PV */
+#define PV_MOVED_VG UINT64_C(0x4000000000000000) /* PV - Moved to a new VG */
#define PARTIAL_LV UINT64_C(0x0000000001000000) /* LV - derived flag, not
written out in metadata*/
@@ -146,7 +147,7 @@
#define LV_RESHAPE UINT64_C(0x1000000000000000) /* Ongoing reshape (number of stripes, stripesize or raid algorithm change):
used as SEGTYPE_FLAG to prevent activation on old runtime */
#define LV_RESHAPE_DATA_OFFSET UINT64_C(0x2000000000000000) /* LV reshape flag data offset (out of place reshaping) */
-/* Next unused flag: UINT64_C(0x4000000000000000) */
+/* Next unused flag: UINT64_C(0x8000000000000000) */
/* Format features flags */
#define FMT_SEGMENTS 0x00000001U /* Arbitrary segment params? */
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index bbbf7d0..c50d579 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -520,6 +520,8 @@ int vg_rename(struct cmd_context *cmd, struct volume_group *vg,
pv_dev_name(pvl->pv));
return 0;
}
+ /* Mark the PVs that still hold metadata with the old VG name */
+ pvl->pv->status |= PV_MOVED_VG;
}
return 1;
@@ -3616,6 +3618,7 @@ static int _vg_commit_mdas(struct volume_group *vg)
int vg_commit(struct volume_group *vg)
{
int cache_updated = 0;
+ struct pv_list *pvl;
if (!lvmcache_vgname_is_locked(vg->name)) {
log_error(INTERNAL_ERROR "Attempt to write new VG metadata "
@@ -3631,11 +3634,14 @@ int vg_commit(struct volume_group *vg)
/* Instruct remote nodes to upgrade cached metadata. */
if (!remote_commit_cached_metadata(vg))
stack; // FIXME: What should we do?
+
/*
* We need to clear old_name after a successful commit.
* The volume_group structure could be reused later.
*/
vg->old_name = NULL;
+ dm_list_iterate_items(pvl, &vg->pvs)
+ pvl->pv->status &= ~PV_MOVED_VG;
/* This *is* the original now that it's commited. */
release_vg(vg->vg_committed);
diff --git a/tools/vgmerge.c b/tools/vgmerge.c
index d49e4e1..86c6a48 100644
--- a/tools/vgmerge.c
+++ b/tools/vgmerge.c
@@ -111,6 +111,8 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
del_pvl_from_vgs(vg_from, pvl);
add_pvl_to_vgs(vg_to, pvl);
pvl->pv->vg_name = dm_pool_strdup(cmd->mem, vg_to->name);
+ /* Mark the VGs that still hold metadata for the old VG */
+ pvl->pv->status |= PV_MOVED_VG;
}
/* Fix up LVIDs */
@@ -168,6 +170,9 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
vg_to->extent_count += vg_from->extent_count;
vg_to->free_count += vg_from->free_count;
+ /* Flag up that some PVs have moved from another VG */
+ vg_to->old_name = vg_from->name;
+
/* store it on disks */
log_verbose("Writing out updated volume group");
if (!vg_write(vg_to) || !vg_commit(vg_to))
6 years, 6 months
master - dmeventd: ensure systemd service gets stopped on shutdown
by Peter Rajnoha
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a781b1c1788461595f3...
Commit: a781b1c1788461595f382918bb1fc210d248d444
Parent: 3ae8adce928d4ce6ef36c87c2a0bb8aa737346b8
Author: Thomas Lamprecht <t.lamprecht(a)proxmox.com>
AuthorDate: Thu Oct 5 12:52:15 2017 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 5 13:01:55 2017 +0200
dmeventd: ensure systemd service gets stopped on shutdown
Add these for dmeventd systemd unit (dm-event.service):
Before: shutdown.target
Conflicts: shutdown.target
This will cause the dmeventd to be properly stopped at shutdown (after
all the dmeventd clients unregistered their devices from monitoring)
with dm-event.service's stop action (there's no direct action defined
for the "stop" so systemd sends SIGTERM instead).
Before, we let dmeventd to get killed only as part of the very last
SIGTERM/SIGKILL for all the remaining processes late in the shutdown
sequence so we may have missed some logs if dmeventd encountered an
error during its shutdown (logging facilities are already off at this
late time in shutdown sequence).
Ref: https://www.redhat.com/archives/lvm-devel/2017-October/msg00000.html
---
scripts/dm_event_systemd_red_hat.service.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/scripts/dm_event_systemd_red_hat.service.in b/scripts/dm_event_systemd_red_hat.service.in
index 7c607aa..4924d39 100644
--- a/scripts/dm_event_systemd_red_hat.service.in
+++ b/scripts/dm_event_systemd_red_hat.service.in
@@ -3,7 +3,8 @@ Description=Device-mapper event daemon
Documentation=man:dmeventd(8)
Requires=dm-event.socket
After=dm-event.socket
-Before=local-fs-pre.target
+Before=local-fs-pre.target shutdown.target
+Conflicts=shutdown.target
DefaultDependencies=no
[Service]
6 years, 6 months