master - cachevol: stop dm errors with uncaching cache with cachevol
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=892a182975049ebe732...
Commit: 892a182975049ebe732860c30c866fe2de5b7717
Parent: 25b97e522d8f0d8226aa3a50c69f0ec9de17b88c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 11 17:11:39 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 17:19:57 2020 +0100
cachevol: stop dm errors with uncaching cache with cachevol
Fix the anoying kernel message reported:
device-mapper: cache: 253:2: metadata operation 'dm_cache_commit' failed: error = -5
which has been reported while cachevol has been removed.
Happened via confusing variable - so switch the variable to commonly user '_size'
which presents a value in sector units and avoid 'scaling' this as extent length
by vg extent size when placing 'error' target on removal path.
Patch shouldn't have impact on actual users data, since at this moment
of removal all date should have been already flushed to origin device.
m
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 14 +++++++-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d1c545b..30f1391 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.09 -
====================================
+ Fix showing of a dm kernel error when uncaching a volume with cachevol.
Version 2.03.08 - 11th February 2020
====================================
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 8569e86..c8a22fb 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3161,8 +3161,8 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
char *dlid_meta;
char *dlid_data;
char *dlid_pool;
- uint64_t meta_len = first_seg(lv)->metadata_len;
- uint64_t data_len = first_seg(lv)->data_len;
+ uint64_t meta_size = first_seg(lv)->metadata_len;
+ uint64_t data_size = first_seg(lv)->data_len;
uint16_t udev_flags = _get_udev_flags(dm, lv, layer,
laopts->noscan, laopts->temporary,
0);
@@ -3210,12 +3210,12 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (dm->track_pending_delete) {
log_debug_activation("Using error for pending meta delete %s.", display_lvname(lv));
- if (!dm_tree_node_add_error_target(dnode_meta, (uint64_t)lv->vg->extent_size * meta_len))
+ if (!dm_tree_node_add_error_target(dnode_meta, meta_size))
return_0;
} else {
/* add load_segment to meta dnode: linear, size of meta area */
if (!add_linear_area_to_dtree(dnode_meta,
- meta_len,
+ meta_size,
lv->vg->extent_size,
lv->vg->cmd->use_linear_target,
lv->vg->name, lv->name))
@@ -3239,19 +3239,19 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (dm->track_pending_delete) {
log_debug_activation("Using error for pending data delete %s.", display_lvname(lv));
- if (!dm_tree_node_add_error_target(dnode_data, (uint64_t)lv->vg->extent_size * data_len))
+ if (!dm_tree_node_add_error_target(dnode_data, data_size))
return_0;
} else {
/* add load_segment to data dnode: linear, size of data area */
if (!add_linear_area_to_dtree(dnode_data,
- data_len,
+ data_size,
lv->vg->extent_size,
lv->vg->cmd->use_linear_target,
lv->vg->name, lv->name))
return_0;
/* add seg_area to prev load_seg: offset 0 maps to cachepool lv after meta */
- if (!dm_tree_node_add_target_area(dnode_data, NULL, dlid_pool, meta_len))
+ if (!dm_tree_node_add_target_area(dnode_data, NULL, dlid_pool, meta_size))
return_0;
}
}
4 years, 1 month
v2_03_08 annotated tag has been created
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=490690356ce890f2d90...
Commit: 490690356ce890f2d90fea3b7f69475ee4ea5296
Parent: 0000000000000000000000000000000000000000
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: 2020-02-11 09:53 +0000
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: 2020-02-11 09:53 +0000
annotated tag: v2_03_08 has been created
at 490690356ce890f2d90fea3b7f69475ee4ea5296 (tag)
tagging b9752d719ce533c10eff9e6dbad560da33f50b65 (commit)
replaces v2_03_07
Release 2.03.08
- IMPORTANT: Prohibit reshape of stacked raid LVs to prevent corruption.
- Improved handling of writecache and VDO volumes.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJeQnrMAAoJELkRJDHlCQOfzpkP/3lsfoRQRTG0hGoa1ZMzazG+
ahz60PvSIjmKfdRvROpPL0xjJ9Uk4WZ3m4UDglkwg874jQ69snO3Enys+xhFcCNV
cmuYlXybRfsjQ0O1jg6K0dfppNXdNwWbmi1ZuiOEXaWeNenvS2wgz3nczxFlLHUA
Ay/xRyP15egnlPjoMsFfoBCuIITB7MmIbdFppPWP7fsLjonHIE6eQKWdDTu3zWgg
i/KmCYIjIpdWZH8hCwW7n5Qw6odKbUMV8eo81szTEuLK2JoRGG+2g018Kc+hutLQ
45grMHdUUi5dQ8JUQwlHgC4xPksIwpzHYkeXuH+MsvW/LzWRK8Pic9G3Gpyzv7LX
yJAPd1V6N/oYBWk1LwV4p2ZmBzL61vmC6QKgYqMLrq/6FpqJNNFjToCRo7R+BqHQ
PC2Xvj05DdB17sPhmmSyPnuyMZlae56HRGbeide4FXeAN3BkFg+eSzn9jo855FZm
7Elt/lbbao6hz5gLjqjL7F+gHS72W1tFOLRVoFEOjz13LkYTODSl1ojH6zIcE/hM
6GAKDFf1tBp8fxC4FOSQQM5slHmkx5IuRaDftw27swhjDlGGluCplrw9646Vuo2I
ErLZb9sOF3mwvT80M0cwidOOcoJ23jm1O//RDh60LS4aY+iw32/5Yozj5jA2DchH
yoUpObU7KyiYP2gchPZn
=cNyC
-----END PGP SIGNATURE-----
David Teigland (19):
pvck: deal with coverity warnings
update option description for settings
man pvck: describe settings
pvck: show specific dump option values
drop warnings about missing pvs in foreign vgs
man: pvck dump description improvements
lvmlockd: use ret value in query function
man: updates to lvmcache
writecache: report status fields
man: lvmcache writecache watermark percent
writecache: reject invalid high/low watermark setting
vgsplit: handle cachevol
pvmove: prevent moving writecache device
tests: move vgsplit writecache
writecache: fix splitcache when origin is raid
writecache: prevent snapshots
writecache: fix return value
writecache: check for invalid cachevol
writecache: skip zeroing in test mode
Heming Zhao (2):
fix corosync.conf: no interface error
add suggestion message for mirror LVs
Marian Csontos (4):
post-release
tests: VDO detection in dbus tests
tests: Some lvmdbus tests require larger PVs
pre-release
Nikhil Kshirsagar (1):
debug: print VG name in log messages for segment errors
Tony Asleson (1):
WHATS_NEW: VDO lvmdbusd adds
Vojtech Trefny (2):
lvmdbusd: Add VDO enable/disable compress & dedup
lvmdbusd: Add function to convert LV into a VDO pool
Zdenek Kabelac (38):
libdm: support device RELOAD with maj:min and devname set
libdm: set maj:min while creating and reloading device
debug: avoid to slashes in debug message
debug: enhance messages
vg_read: use else for 3 case
clenaup: simpler form
test: aux setup
test: fail on device create
test: fix missing waiting on udev
tests: improve secure test
raid: disallow reshape of stacked LVs
vdo: avoid running initialization of cache pool vars
tests: update for readahead
WHATS_NEW: update
raid: more limitted prohibition of stacked raid usage
vdo: adapt for multi line vdo_format output
tests: writeerror_dev
tests: add corruption write on PV test
WHATS_NEW: update
tests: compatible with older kernels
dmsetup: no memleak on failed realocation
pvck: avoid memleak of vgname
bcache: fix memleak on error path
cov: unused header file removal
cov: widen before calculating min_chunk_size
cov: check error code from mutex init
lvmlockd: move eval of ENOENT
lvmlockctl: ensure result value is always defined
lvmlockctl: use inline initilizers
dmeventd: nicer error path for reading pipe
command: validate reporting of previous argument
lv_manip: add error handling for _reserve_area
raid: add internal error for no segment
lv_manip: add extra check for existin origin_lv
generate: remake
WHATS_NEW: update
raid: better place for blocking reshapes
vdo: fix vdoformat when -V is specified
4 years, 1 month
master - post-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=25b97e522d8f0d8226a...
Commit: 25b97e522d8f0d8226aa3a50c69f0ec9de17b88c
Parent: b9752d719ce533c10eff9e6dbad560da33f50b65
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Feb 11 10:53:01 2020 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Feb 11 10:53:01 2020 +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 c5cc2e463..d19920bf8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.03.08(2) (2020-02-11)
+2.03.09(2)-git (2020-02-11)
diff --git a/VERSION_DM b/VERSION_DM
index f90962518..b3b975d24 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.169 (2020-02-11)
+1.02.171-git (2020-02-11)
diff --git a/WHATS_NEW b/WHATS_NEW
index 50a00452a..d1c545b45 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.03.09 -
+====================================
+
Version 2.03.08 - 11th February 2020
====================================
Prevent problematic snapshots of writecache volumes.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index eb8b84c36..c707538fc 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.171 -
+=====================================
+
Version 1.02.169 - 11th February 2020
=====================================
Enhance error messages for device creation.
4 years, 1 month
master - pre-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b9752d719ce533c10ef...
Commit: b9752d719ce533c10eff9e6dbad560da33f50b65
Parent: 3716aa848efef716ba8596d585a312fdb61850d3
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Feb 11 10:50:50 2020 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Feb 11 10:51:57 2020 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 6 +++++-
WHATS_NEW_DM | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/VERSION b/VERSION
index 51f8e6909..c5cc2e463 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.03.08(2)-git (2019-11-30)
+2.03.08(2) (2020-02-11)
diff --git a/VERSION_DM b/VERSION_DM
index 933e2d397..f90962518 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.169-git (2019-11-30)
+1.02.169 (2020-02-11)
diff --git a/WHATS_NEW b/WHATS_NEW
index b03eb9732..50a00452a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,9 +1,13 @@
-Version 2.03.08 -
+Version 2.03.08 - 11th February 2020
====================================
+ Prevent problematic snapshots of writecache volumes.
Add error handling for failing allocation in _reserve_area().
Fix memleak in syncing of internal cache.
Fix pvck dump_current_text memleak.
Fix lvmlockd result code on error path for _query_lock_lv().
+ Update pvck man page and help output.
+ Reject invalid writecache high/low_watermark setting.
+ Report writecache status.
Accept more output lines from vdo_format.
Prohibit reshaping of stacked raid LVs.
Avoid running cache input arg validation when creating vdo pool.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index a1e233e67..eb8b84c36 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,4 +1,4 @@
-Version 1.02.169 -
+Version 1.02.169 - 11th February 2020
=====================================
Enhance error messages for device creation.
4 years, 1 month
stable-2.02 - raid: better place for blocking reshapes
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=253d10f840682f85dad...
Commit: 253d10f840682f85dad0e4c29f55ff50f94792fa
Parent: bcf9556b8fcd16ad8997f80cc92785f295c66701
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Feb 7 15:14:05 2020 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Feb 10 15:44:46 2020 +0100
raid: better place for blocking reshapes
Still the place can be better to block only particular reshape
operations which ATM cause kernel problems.
We check if the new number of images is higher - and prevent to take
conversion if the volume is in use (i.e. thin-pool's data LV).
(cherry picked from commit 96985b1373d58b411a80c2985f348466e78cbe6e)
---
lib/metadata/raid_manip.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 0b0c09181..f51e9c401 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -2298,6 +2298,13 @@ static int _raid_reshape(struct logical_volume *lv,
if ((new_image_count = new_stripes + seg->segtype->parity_devs) < 2)
return_0;
+ /* FIXME Can't reshape volume in use - aka not toplevel devices */
+ if (old_image_count < new_image_count &&
+ !dm_list_empty(&seg->lv->segs_using_this_lv)) {
+ log_error("Unable to convert stacked volume %s.", display_lvname(seg->lv));
+ return 0;
+ }
+
if (!_check_max_raid_devices(new_image_count))
return_0;
@@ -6217,12 +6224,6 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
if (!(*segtype = get_segtype_from_flag(cmd, seg_flag)))
return_0;
- /* FIXME Can't reshape volume in use - aka not toplevel devices */
- if (!dm_list_empty(&seg_from->lv->segs_using_this_lv)) {
- log_error("Can't reshape stacked volume %s.", display_lvname(seg_from->lv));
- return 0;
- }
-
if (segtype_sav != *segtype) {
log_warn("Replaced LV type %s%s with possible type %s.",
segtype_sav->name, _get_segtype_alias_str(seg_from->lv, segtype_sav),
4 years, 1 month
master - vdo: fix vdoformat when -V is specified
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3716aa848efef716ba8...
Commit: 3716aa848efef716ba8596d585a312fdb61850d3
Parent: 8f794f2095583d41393ee9c697f470015b29f064
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Feb 10 15:41:30 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 10 15:41:30 2020 +0100
vdo: fix vdoformat when -V is specified
The previous patch improved read of pipe when lvm2 was looking
for default logical size, but we clearly must read pipe also
for -V case, when the logical size is already defined.
---
lib/metadata/vdo_manip.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index b690e73..335e7dd 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -316,19 +316,19 @@ static int _format_vdo_pool_data_lv(struct logical_volume *data_lv,
return 0;
}
- if (!*logical_size)
- while (!feof(f) && fgets(buf, sizeof(buf), f)) {
- /* TODO: Watch out for locales */
+ while (!feof(f) && fgets(buf, sizeof(buf), f)) {
+ /* TODO: Watch out for locales */
+ if (!*logical_size)
if (sscanf(buf, "Logical blocks defaulted to " FMTu64 " blocks", &lb) == 1) {
*logical_size = lb * DM_VDO_BLOCK_SIZE;
log_verbose("Available VDO logical blocks " FMTu64 " (%s).",
lb, display_size(data_lv->vg->cmd, *logical_size));
}
- if ((dpath = strchr(buf, '\n')))
- *dpath = 0; /* cut last '\n' away */
- if (buf[0])
- log_print(" %s", buf); /* Print vdo_format messages */
- }
+ if ((dpath = strchr(buf, '\n')))
+ *dpath = 0; /* cut last '\n' away */
+ if (buf[0])
+ log_print(" %s", buf); /* Print vdo_format messages */
+ }
if (!pipe_close(&pdata)) {
log_error("Command %s failed.", argv[0]);
4 years, 1 month
master - writecache: skip zeroing in test mode
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8f794f2095583d41393...
Commit: 8f794f2095583d41393ee9c697f470015b29f064
Parent: 744b75f88158156f7d8ffe6c2bc5af9856e63258
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 7 10:32:10 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 7 10:32:10 2020 -0600
writecache: skip zeroing in test mode
---
tools/lvconvert.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index a1fb8c1..cd9a3e8 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5351,6 +5351,9 @@ static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv)
};
int ret;
+ if (test_mode())
+ return 1;
+
if (!activate_lv(cmd, lv)) {
log_error("Failed to activate LV %s for zeroing.", display_lvname(lv));
return 0;
4 years, 1 month
master - writecache: check for invalid cachevol
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=744b75f88158156f7d8...
Commit: 744b75f88158156f7d8ffe6c2bc5af9856e63258
Parent: b756cb3e49b762b3a5160f9748aeb5bf995ae80e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 7 10:26:59 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 7 10:26:59 2020 -0600
writecache: check for invalid cachevol
---
tools/lvconvert.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index a83b019..a1fb8c1 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5578,6 +5578,11 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
goto bad;
}
+ if (lv_fast == lv) {
+ log_error("Invalid cachevol LV.");
+ goto bad;
+ }
+
if (!seg_is_linear(first_seg(lv_fast))) {
log_error("LV %s must be linear to use as a writecache.", display_lvname(lv_fast));
goto bad;
4 years, 1 month
master - writecache: fix return value
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b756cb3e49b762b3a51...
Commit: b756cb3e49b762b3a5160f9748aeb5bf995ae80e
Parent: 96985b1373d58b411a80c2985f348466e78cbe6e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 7 10:21:07 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 7 10:21:07 2020 -0600
writecache: fix return value
---
tools/lvconvert.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index f6a329b..a83b019 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5580,13 +5580,13 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
if (!seg_is_linear(first_seg(lv_fast))) {
log_error("LV %s must be linear to use as a writecache.", display_lvname(lv_fast));
- return 0;
+ goto bad;
}
/* fast LV shouldn't generally be active by itself, but just in case. */
if (lv_info(cmd, lv_fast, 1, NULL, 0, 0)) {
log_error("LV %s must be inactive to attach.", display_lvname(lv_fast));
- return 0;
+ goto bad;
}
memset(&settings, 0, sizeof(settings));
@@ -5594,13 +5594,13 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
if (!_get_writecache_settings(cmd, &settings, &block_size_sectors)) {
log_error("Invalid writecache settings.");
- return 0;
+ goto bad;
}
if (!arg_is_set(cmd, yes_ARG) &&
yes_no_prompt("Erase all existing data on %s? [y/n]: ", display_lvname(lv_fast)) == 'n') {
log_error("Conversion aborted.");
- return 0;
+ goto bad;
}
/* Ensure the two LVs are not active elsewhere. */
4 years, 1 month
master - raid: better place for blocking reshapes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=96985b1373d58b411a8...
Commit: 96985b1373d58b411a80c2985f348466e78cbe6e
Parent: ffea7daec3d09fb4315104bb346cfa9d6db6f9e9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Feb 7 15:14:05 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Feb 7 16:48:48 2020 +0100
raid: better place for blocking reshapes
Still the place can be better to block only particular reshape
operations which ATM cause kernel problems.
We check if the new number of images is higher - and prevent to take
conversion if the volume is in use (i.e. thin-pool's data LV).
---
lib/metadata/raid_manip.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index dfc6fe5..fa1b91a 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -2298,6 +2298,13 @@ static int _raid_reshape(struct logical_volume *lv,
if ((new_image_count = new_stripes + seg->segtype->parity_devs) < 2)
return_0;
+ /* FIXME Can't reshape volume in use - aka not toplevel devices */
+ if (old_image_count < new_image_count &&
+ !dm_list_empty(&seg->lv->segs_using_this_lv)) {
+ log_error("Unable to convert stacked volume %s.", display_lvname(seg->lv));
+ return 0;
+ }
+
if (!_check_max_raid_devices(new_image_count))
return_0;
@@ -6216,12 +6223,6 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
if (!(*segtype = get_segtype_from_flag(cmd, seg_flag)))
return_0;
- /* FIXME Can't reshape volume in use - aka not toplevel devices */
- if (!dm_list_empty(&seg_from->lv->segs_using_this_lv)) {
- log_error("Can't reshape stacked volume %s.", display_lvname(seg_from->lv));
- return 0;
- }
-
if (segtype_sav != *segtype) {
log_warn("Replaced LV type %s%s with possible type %s.",
segtype_sav->name, _get_segtype_alias_str(seg_from->lv, segtype_sav),
4 years, 1 month