master - activate_lvs: deactivate on uniterate
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c820b43fc053689eac0...
Commit: c820b43fc053689eac0a60cd732347c8eb30ad5d
Parent: eab9097b46b10ce61344c02934fe5c44b9f8c7c7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Nov 14 11:35:50 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 15 12:11:33 2017 +0100
activate_lvs: deactivate on uniterate
When activation of LVs fails prior pvmove start, try to deactivate
already activated LVs.
TODO: possibly remember which LVs where already activate and only those
take down - devices which are already in-use will stay active.
---
WHATS_NEW | 1 +
lib/locking/locking.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d3670bc..728cc4f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Deactivate activated LVs on error path when pvmove activation fails.
Add "io" to log/debug_classes for logging low-level I/O.
Eliminate redundant nested VG metadata in VG struct.
Avoid importing persistent filter in vgscan/pvscan/vgrename.
diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index bf39b4a..067cd69 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -475,7 +475,7 @@ int activate_lvs(struct cmd_context *cmd, struct dm_list *lvs, unsigned exclusiv
log_error("Failed to activate %s", lvl->lv->name);
dm_list_uniterate(lvh, lvs, &lvl->list) {
lvl = dm_list_item(lvh, struct lv_list);
- if (!activate_lv(cmd, lvl->lv))
+ if (!deactivate_lv(cmd, lvl->lv))
stack;
}
return 0;
6 years, 5 months
master - pvmove: return pvmove itself
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cc854c0617034613b03...
Commit: cc854c0617034613b0335e43eaabf4e4ff2a26bd
Parent: 919744375e21856ee6511f5f7185c3773d60da0b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Nov 14 20:44:32 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 15 11:51:53 2017 +0100
pvmove: return pvmove itself
When find_pvmove_lv_in_lv() get already a 'pvmoving' LV - return it.
---
lib/metadata/mirror.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 238ce37..c89408c 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -1512,6 +1512,9 @@ const struct logical_volume *find_pvmove_lv_in_lv(const struct logical_volume *l
const struct lv_segment *seg;
uint32_t s;
+ if (lv_is_pvmove(lv))
+ return lv;
+
dm_list_iterate_items(seg, &lv->segments) {
for (s = 0; s < seg->area_count; s++) {
if (seg_type(seg, s) != AREA_LV)
6 years, 5 months
master - layers: collect only lock holding LVs
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=eab9097b46b10ce6134...
Commit: eab9097b46b10ce61344c02934fe5c44b9f8c7c7
Parent: cc854c0617034613b0335e43eaabf4e4ff2a26bd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 9 11:41:16 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 15 12:11:33 2017 +0100
layers: collect only lock holding LVs
---
lib/metadata/lv_manip.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 4fc9708..33a4f7d 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7057,6 +7057,7 @@ int insert_layer_for_segments_on_pv(struct cmd_context *cmd,
struct lv_list *lvl;
int lv_used = 0;
uint32_t s;
+ struct logical_volume *holder = (struct logical_volume *) lv_lock_holder(lv_where);
log_very_verbose("Inserting layer %s for segments of %s on %s",
layer_lv->name, lv_where->name,
@@ -7083,13 +7084,23 @@ int insert_layer_for_segments_on_pv(struct cmd_context *cmd,
/* First time, add LV to list of LVs affected */
if (!lv_used && lvs_changed) {
- if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl)))) {
- log_error("lv_list alloc failed");
- return 0;
+ /* First check if LV is listed already */
+ dm_list_iterate_items(lvl, lvs_changed)
+ if (lvl->lv == holder) {
+ lv_used = 1;
+ break;
+ }
+
+ if (!lv_used) {
+ if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl)))) {
+ log_error("lv_list alloc failed.");
+ return 0;
+ }
+
+ lvl->lv = holder;
+ dm_list_add(lvs_changed, &lvl->list);
+ lv_used = 1;
}
- lvl->lv = lv_where;
- dm_list_add(lvs_changed, &lvl->list);
- lv_used = 1;
}
if (!_extend_layer_lv_for_segment(layer_lv, seg, s,
6 years, 5 months
master - pvmove: snapshots need to go with origin device
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=919744375e21856ee65...
Commit: 919744375e21856ee6511f5f7185c3773d60da0b
Parent: 7c5531b4ca2bb261a7a37fd1c895963afb9d80e8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 10 21:18:55 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 15 11:51:53 2017 +0100
pvmove: snapshots need to go with origin device
Enable future support for pvmove for COW LVs.
---
lib/activate/dev_manager.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 29727df..1ca3baa 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1939,6 +1939,7 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
struct lv_segment *seg;
struct dm_tree_node *node;
const char *uuid;
+ const struct logical_volume *plv;
if (lv_is_cache_pool(lv)) {
if (!dm_list_empty(&lv->segs_using_this_lv)) {
@@ -2061,9 +2062,12 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
/* Add any LVs referencing a PVMOVE LV unless told not to. */
if (dm->track_pvmove_deps && lv_is_pvmove(lv)) {
dm->track_pvmove_deps = 0;
- dm_list_iterate_items(sl, &lv->segs_using_this_lv)
- if (!_add_lv_to_dtree(dm, dtree, sl->seg->lv, origin_only))
+ dm_list_iterate_items(sl, &lv->segs_using_this_lv) {
+ /* If LV is snapshot COW - whole snapshot needs reload */
+ plv = lv_is_cow(sl->seg->lv) ? origin_from_cow(sl->seg->lv) : sl->seg->lv;
+ if (!_add_lv_to_dtree(dm, dtree, plv, 0))
return_0;
+ }
dm->track_pvmove_deps = 1;
}
6 years, 5 months
master - Update WHATS_NEW
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7c5531b4ca2bb261a7a...
Commit: 7c5531b4ca2bb261a7a37fd1c895963afb9d80e8
Parent: fe63c09381103324c52cc380a80cef21b693e9db
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Nov 15 10:01:50 2017 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Nov 15 10:01:50 2017 +0100
Update WHATS_NEW
---
WHATS_NEW | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 7db534c..d3670bc 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -6,6 +6,11 @@ Version 2.02.177 -
Fix memleak of string buffer when vgcfgbackup runs in secure mode.
Do not print error when clvmd cannot find running clvmd.
Prevent start of new merge of snapshot if origin is already being merged.
+ Fix offered type for raid6_n_6 to raid5 conversion (raid5_n).
+ Deactivate sub LVs when removing unused cache-pool.
+ Do not take backup with suspended devices.
+ Avoid RAID4 activation on incompatible kernels under all circumstances.
+ Reject conversion request to striped/raid0 on 2-legged raid4/5.
Version 2.02.176 - 3rd November 2017
====================================
6 years, 5 months
master - regenerate man and conf
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fe63c09381103324c52...
Commit: fe63c09381103324c52cc380a80cef21b693e9db
Parent: 02e987666540712a9467025bf36e46e041da2611
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Nov 15 01:05:07 2017 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Nov 15 01:05:07 2017 +0000
regenerate man and conf
---
conf/example.conf.in | 4 +-
man/lvconvert.8_pregen | 50 ++++++++++++++++++++++++------------------------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index b5b0e6a..aab274d 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -611,9 +611,9 @@ log {
# Select log messages by class.
# Some debugging messages are assigned to a class and only appear in
# debug output if the class is listed here. Classes currently
- # available: memory, devices, activation, allocation, lvmetad,
+ # available: memory, devices, io, activation, allocation, lvmetad,
# metadata, cache, locking, lvmpolld. Use "all" to see everything.
- debug_classes = [ "memory", "devices", "activation", "allocation", "lvmetad", "metadata", "cache", "locking", "lvmpolld", "dbus" ]
+ debug_classes = [ "memory", "devices", "io", "activation", "allocation", "lvmetad", "metadata", "cache", "locking", "lvmpolld", "dbus" ]
}
# Configuration section backup.
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index fb2d869..243d1c3 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -751,6 +751,31 @@ Merge COW snapshot LV into its origin.
.br
-
+Combine a former COW snapshot (second arg) with a former
+.br
+origin LV (first arg) to reverse a splitsnapshot command.
+.br
+.P
+\fBlvconvert\fP \fB--type\fP \fBsnapshot\fP \fILV\fP \fILV\fP\fI_linear\fP
+.br
+.RS 4
+.ad l
+[ \fB-s\fP|\fB--snapshot\fP ]
+.ad b
+.br
+.ad l
+[ \fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT] ]
+.ad b
+.br
+.ad l
+[ \fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP ]
+.ad b
+.br
+[ COMMON_OPTIONS ]
+.RE
+.br
+-
+
Replace failed PVs in a raid or mirror LV.
.br
Repair a thin pool.
@@ -1654,31 +1679,6 @@ Combine a former COW snapshot (second arg) with a former
origin LV (first arg) to reverse a splitsnapshot command.
.br
.P
-\fBlvconvert\fP \fB--type\fP \fBsnapshot\fP \fILV\fP \fILV\fP\fI_linear\fP
-.br
-.RS 4
-.ad l
-[ \fB-s\fP|\fB--snapshot\fP ]
-.ad b
-.br
-.ad l
-[ \fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT] ]
-.ad b
-.br
-.ad l
-[ \fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP ]
-.ad b
-.br
-[ COMMON_OPTIONS ]
-.RE
-.br
--
-
-Combine a former COW snapshot (second arg) with a former
-.br
-origin LV (first arg) to reverse a splitsnapshot command.
-.br
-.P
\fBlvconvert\fP \fB-s\fP|\fB--snapshot\fP \fILV\fP \fILV\fP\fI_linear\fP
.br
.RS 4
6 years, 5 months
master - log: Add io debug class
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=02e987666540712a946...
Commit: 02e987666540712a9467025bf36e46e041da2611
Parent: b5f62a143dcc83bcc12910400b177620a8f49b7c
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Nov 15 00:59:30 2017 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Nov 15 01:02:15 2017 +0000
log: Add io debug class
---
WHATS_NEW | 1 +
lib/commands/toolcontext.c | 2 ++
lib/config/config_settings.h | 4 ++--
lib/device/dev-io.c | 5 +++++
lib/log/log.h | 2 ++
5 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 04229da..7db534c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Add "io" to log/debug_classes for logging low-level I/O.
Eliminate redundant nested VG metadata in VG struct.
Avoid importing persistent filter in vgscan/pvscan/vgrename.
Fix memleak of string buffer when vgcfgbackup runs in secure mode.
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index e742df5..1985c30 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -283,6 +283,8 @@ static int _parse_debug_classes(struct cmd_context *cmd)
debug_classes |= LOG_CLASS_LVMPOLLD;
else if (!strcasecmp(cv->v.str, "dbus"))
debug_classes |= LOG_CLASS_DBUS;
+ else if (!strcasecmp(cv->v.str, "io"))
+ debug_classes |= LOG_CLASS_IO;
else
log_verbose("Unrecognised value for log/debug_classes: %s", cv->v.str);
}
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 7d800b3..077fb15 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -705,11 +705,11 @@ cfg(log_activation_CFG, "activation", log_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(
cfg(log_activate_file_CFG, "activate_file", log_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_UNSUPPORTED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL, NULL)
-cfg_array(log_debug_classes_CFG, "debug_classes", log_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, "#Smemory#Sdevices#Sactivation#Sallocation#Slvmetad#Smetadata#Scache#Slocking#Slvmpolld#Sdbus", vsn(2, 2, 99), NULL, 0, NULL,
+cfg_array(log_debug_classes_CFG, "debug_classes", log_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, "#Smemory#Sdevices#Sio#Sactivation#Sallocation#Slvmetad#Smetadata#Scache#Slocking#Slvmpolld#Sdbus", vsn(2, 2, 99), NULL, 0, NULL,
"Select log messages by class.\n"
"Some debugging messages are assigned to a class and only appear in\n"
"debug output if the class is listed here. Classes currently\n"
- "available: memory, devices, activation, allocation, lvmetad,\n"
+ "available: memory, devices, io, activation, allocation, lvmetad,\n"
"metadata, cache, locking, lvmpolld. Use \"all\" to see everything.\n")
cfg(backup_backup_CFG, "backup", backup_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_BACKUP_ENABLED, vsn(1, 0, 0), NULL, 0, NULL,
diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index 328ec30..24bc81c 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -72,6 +72,11 @@ static int _io(struct device_area *where, char *buffer, int should_write)
return 0;
}
+ log_debug_io("%s %s:%8" PRIu64 " bytes (sync) at %" PRIu64 "%s",
+ should_write ? "Write" : "Read ", dev_name(where->dev),
+ where->size, (uint64_t) where->start,
+ (should_write && test_mode()) ? " (test mode - suppressed)" : "");
+
/*
* Skip all writes in test mode.
*/
diff --git a/lib/log/log.h b/lib/log/log.h
index 0ce4fda..256fed0 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -72,6 +72,7 @@
#define LOG_CLASS_LOCKING 0x0080 /* "locking" */
#define LOG_CLASS_LVMPOLLD 0x0100 /* "lvmpolld" */
#define LOG_CLASS_DBUS 0x0200 /* "dbus" */
+#define LOG_CLASS_IO 0x0400 /* "io" */
#define log_debug(x...) LOG_LINE(_LOG_DEBUG, x)
#define log_debug_mem(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_MEM, x)
@@ -84,6 +85,7 @@
#define log_debug_locking(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_LOCKING, x)
#define log_debug_lvmpolld(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_LVMPOLLD, x)
#define log_debug_dbus(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_DBUS, x)
+#define log_debug_io(x...) LOG_LINE_WITH_CLASS(_LOG_DEBUG, LOG_CLASS_IO, x)
#define log_info(x...) LOG_LINE(_LOG_INFO, x)
#define log_notice(x...) LOG_LINE(_LOG_NOTICE, x)
6 years, 5 months
master - metadata: Eliminate redundant nested VG metadata
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b5f62a143dcc83bcc12...
Commit: b5f62a143dcc83bcc12910400b177620a8f49b7c
Parent: 7a5728fb4c748b911f829c5cda0768c6289a4512
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Nov 14 15:38:55 2017 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Nov 14 15:38:55 2017 +0000
metadata: Eliminate redundant nested VG metadata
Only lv_committed() now uses vg->vg_committed and it appears redundant
if its contents match the enclosing VG so don't waste cycles creating it
when that's known to be true when no write lock is held so the struct
won't get modified.
---
WHATS_NEW | 1 +
lib/metadata/metadata.c | 64 ++++++++++++++++++++++-------------------------
2 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 1c8838c..04229da 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Eliminate redundant nested VG metadata in VG struct.
Avoid importing persistent filter in vgscan/pvscan/vgrename.
Fix memleak of string buffer when vgcfgbackup runs in secure mode.
Do not print error when clvmd cannot find running clvmd.
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 56c11e6..a14dfa6 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -897,46 +897,41 @@ int vgcreate_params_validate(struct cmd_context *cmd,
return 1;
}
+static void _vg_wipe_cached_precommitted(struct volume_group *vg)
+{
+ release_vg(vg->vg_precommitted);
+ vg->vg_precommitted = NULL;
+}
+
+static void _vg_move_cached_precommitted_to_committed(struct volume_group *vg)
+{
+ release_vg(vg->vg_committed);
+ vg->vg_committed = vg->vg_precommitted;
+ vg->vg_precommitted = NULL;
+}
+
/*
* Update content of precommitted VG
*
* TODO: Optimize in the future, since lvmetad needs similar
* config tree processing in lvmetad_vg_update().
*/
-static int _vg_update_vg_precommitted(struct volume_group *vg)
+static int _vg_update_embedded_copy(struct volume_group *vg, struct volume_group **vg_embedded)
{
- struct dm_config_tree *cft_precommitted;
+ struct dm_config_tree *cft;
- release_vg(vg->vg_precommitted);
- vg->vg_precommitted = NULL;
+ _vg_wipe_cached_precommitted(vg);
/* Copy the VG using an export followed by import */
- if (!(cft_precommitted = export_vg_to_config_tree(vg)))
+ if (!(cft = export_vg_to_config_tree(vg)))
return_0;
- if (!(vg->vg_precommitted = import_vg_from_config_tree(cft_precommitted, vg->fid))) {
- dm_config_destroy(cft_precommitted);
+ if (!(*vg_embedded = import_vg_from_config_tree(cft, vg->fid))) {
+ dm_config_destroy(cft);
return_0;
}
- dm_config_destroy(cft_precommitted);
-
- return 1;
-}
-
-static int _vg_update_vg_committed(struct volume_group *vg)
-{
- if (dm_pool_locked(vg->vgmem))
- return 1;
-
- if (vg->vg_committed || is_orphan_vg(vg->name)) /* we already have it */
- return 1;
-
- if (!_vg_update_vg_precommitted(vg))
- return_0;
-
- vg->vg_committed = vg->vg_precommitted;
- vg->vg_precommitted = NULL;
+ dm_config_destroy(cft);
return 1;
}
@@ -949,7 +944,6 @@ static struct volume_group *_vg_make_handle(struct cmd_context *cmd,
struct volume_group *vg,
uint32_t failure)
{
-
/* Never return a cached VG structure for a failure */
if (vg && vg->vginfo && failure != SUCCESS) {
release_vg(vg);
@@ -961,8 +955,13 @@ static struct volume_group *_vg_make_handle(struct cmd_context *cmd,
vg->read_status = failure;
- if (vg->fid && !_vg_update_vg_committed(vg))
- vg->read_status |= FAILED_ALLOCATION;
+ /*
+ * If we hold a write lock and might be changing the VG contents, embed a pristine
+ * copy of the VG metadata for the activation code to use later
+ */
+ if (vg->fid && !dm_pool_locked(vg->vgmem) && !vg->vg_committed && !is_orphan_vg(vg->name))
+ if (vg_write_lock_held() && !_vg_update_embedded_copy(vg, &vg->vg_committed))
+ vg->read_status |= FAILED_ALLOCATION;
return vg;
}
@@ -3092,7 +3091,7 @@ int vg_write(struct volume_group *vg)
}
}
- if (!_vg_update_vg_precommitted(vg)) /* prepare precommited */
+ if (!_vg_update_embedded_copy(vg, &vg->vg_precommitted)) /* prepare precommited */
return_0;
lockd_vg_update(vg);
@@ -3177,9 +3176,7 @@ int vg_commit(struct volume_group *vg)
pvl->pv->status &= ~PV_MOVED_VG;
/* This *is* the original now that it's commited. */
- release_vg(vg->vg_committed);
- vg->vg_committed = vg->vg_precommitted;
- vg->vg_precommitted = NULL;
+ _vg_move_cached_precommitted_to_committed(vg);
}
/* If update failed, remove any cached precommitted metadata. */
@@ -3212,8 +3209,7 @@ void vg_revert(struct volume_group *vg)
}
}
- release_vg(vg->vg_precommitted); /* VG is no longer needed */
- vg->vg_precommitted = NULL;
+ _vg_wipe_cached_precommitted(vg); /* VG is no longer needed */
dm_list_iterate_items(mda, &vg->fid->metadata_areas_in_use) {
if (mda->ops->vg_revert &&
6 years, 5 months
master - test: additional avoid have_raid overhead
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7a5728fb4c748b911f8...
Commit: 7a5728fb4c748b911f829c5cda0768c6289a4512
Parent: 97750cd12f2ae47d12881a9c8ee655b4bfb52737
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Tue Nov 14 14:17:54 2017 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Nov 14 14:41:44 2017 +0000
test: additional avoid have_raid overhead
---
test/shell/lvcreate-large-raid.sh | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvcreate-large-raid.sh b/test/shell/lvcreate-large-raid.sh
index 1082731..3488db4 100644
--- a/test/shell/lvcreate-large-raid.sh
+++ b/test/shell/lvcreate-large-raid.sh
@@ -21,6 +21,8 @@ SKIP_WITH_LVMPOLLD=1
aux can_use_16T || skip
aux have_raid 1 3 0 || skip
+v1_9_0=0
+aux have_raid 1 9 0 && v1_9_0=1
segtypes="raid5"
aux have_raid4 && segtypes="raid4 raid5"
@@ -78,7 +80,7 @@ lvremove -ff $vg1
# Check --nosync is rejected for raid6
-if aux have_raid 1 9 0 ; then
+if [ $v1_9_0 -eq 1 ] ; then
not lvcreate --type raid6 -i 3 -L 750T -n $lv1 $vg1 --nosync
fi
@@ -103,7 +105,7 @@ lvremove -ff $vg1
lvcreate -aey -L 200T -n $lv1 $vg1
lvconvert -y --type raid1 -m 1 $vg1/$lv1
check lv_field $vg1/$lv1 size "200.00t"
-if aux have_raid 1 9 0; then
+if [ $v1_9_0 -eq 1 ] ; then
# The 1.9.0 version of dm-raid is capable of performing
# linear -> RAID1 upconverts as "recover" not "resync"
# The LVM code now checks the dm-raid version when
6 years, 5 months
master - test: avoid have_raid overhead
by Alasdair Kergon
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=97750cd12f2ae47d128...
Commit: 97750cd12f2ae47d12881a9c8ee655b4bfb52737
Parent: ebd0fed0ceb982503ac474c2e6579a45a983e305
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Tue Nov 14 14:15:09 2017 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Nov 14 14:41:15 2017 +0000
test: avoid have_raid overhead
---
test/shell/lvchange-rebuild-raid.sh | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/test/shell/lvchange-rebuild-raid.sh b/test/shell/lvchange-rebuild-raid.sh
index 4f535e6..5579106 100644
--- a/test/shell/lvchange-rebuild-raid.sh
+++ b/test/shell/lvchange-rebuild-raid.sh
@@ -16,6 +16,8 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
aux have_raid 1 3 2 || skip
+v1_9_0=0
+aux have_raid 1 9 && v1_9_0=1
aux prepare_vg 8
get_devs
@@ -47,17 +49,17 @@ _sync
# Rebuild 1st and 2nd device would rebuild a
# whole mirror group and needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" $vg/$lv1
-not check raid_leg_status $vg $lv1 "aAaAAAAA"
+not check raid_leg_status $vg $lv1 "aaAAAAA"
_sync "AAAAAAAA"
# Rebuild 1st and 3rd device from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAAAAA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "aAaAAAAA"
_sync "AAAAAAAA"
# Rebuild devices 1, 3, 6 from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev6" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAAaAA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "aAaAAaAA"
_sync "AAAAAAAA"
# Rebuild devices 1, 3, 5 and 6 with 5+6 being
@@ -68,12 +70,12 @@ _sync "AAAAAAAA"
# Rebuild devices 1, 3, 5 and 7 from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev5" --rebuild "$dev7" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAaAaA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "aAaAaAaA"
_sync
# Rebuild devices 2, 4, 6 and 8 from different mirror groups is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" --rebuild "$dev8" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAaAa"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "AaAaAaAa"
_sync "AAAAAAAA"
##############################################
@@ -91,17 +93,17 @@ _sync "AAAAAAAA"
# Rebuilding all but the raid1 master leg is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev3" --rebuild "$dev4" \
--rebuild "$dev5" --rebuild "$dev6" --rebuild "$dev7" --rebuild "$dev8" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "Aaaaaaaa"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "Aaaaaaaa"
_sync "AAAAAAAA"
# Rebuilding the raid1 master leg is fine.
lvchange --yes --rebuild "$dev1" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAAAAAAA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "aAAAAAAA"
_sync "AAAAAAAA"
# Rebuild legs on devices 2, 4, 6 and 8 is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" --rebuild "$dev8" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAaAa"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "AaAaAaAa"
_sync "AAAAAAAA"
##############################################
@@ -123,20 +125,20 @@ _sync "AAAAAA"
# Rebuilding any 1 raid6 stripe is fine.
lvchange --yes --rebuild "$dev2" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAAAA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "AaAAAA"
_sync
lvchange --yes --rebuild "$dev5" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AAAAaA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "AAAAaA"
_sync "AAAAAA"
# Rebuilding any 2 raid6 stripes is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "AaAaAA"
_sync "AAAAAA"
lvchange --yes --rebuild "$dev1" --rebuild "$dev5" $vg/$lv1
-aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAAAaA"
+[ $v1_9_0 -eq 1 ] && check raid_leg_status $vg $lv1 "aAAAaA"
_sync "AAAAAA"
vgremove -ff $vg
6 years, 5 months