master - lvremove: for unused cache deactive sublv
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=52cee9dd83da0b9b676...
Commit: 52cee9dd83da0b9b6766a4b3ee6bdd3699bf4346
Parent: 55b8204ca3ca9fe05bc04cb1e1f3fc24ebbdfe48
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Nov 11 00:19:04 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Nov 11 00:59:19 2017 +0100
lvremove: for unused cache deactive sublv
---
lib/metadata/lv_manip.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index d06b459..4fc9708 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6357,6 +6357,15 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
!_lv_remove_segs_using_this_lv(cmd, lv, force, level, "pool"))
return_0;
+ if (lv_is_cache_pool(lv) && !lv_is_used_cache_pool(lv)) {
+ if (!deactivate_lv(cmd, first_seg(lv)->metadata_lv) ||
+ !deactivate_lv(cmd, seg_lv(first_seg(lv),0))) {
+ log_error("Unable to fully deactivate unused cache-pool %s.",
+ display_lvname(lv));
+ return 0;
+ }
+ }
+
if (lv_is_pool_metadata_spare(lv) &&
(force == PROMPT)) {
dm_list_iterate_items(lvl, &lv->vg->lvs)
6 years, 4 months
master - reload: do not take backup with suspended devices
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=55b8204ca3ca9fe05bc...
Commit: 55b8204ca3ca9fe05bc04cb1e1f3fc24ebbdfe48
Parent: 1ac7fde67b10c2bdfa37d1cf3f2ce48033f27baf
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 10 13:28:33 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Nov 11 00:58:11 2017 +0100
reload: do not take backup with suspended devices
If the suspend/resume sequence would leave some device in suspend
for possible later resume, backup cannot be takes (fs holding backups
could be still frozen in critical section())
---
lib/metadata/lv_manip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 41b52ec..d06b459 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6413,7 +6413,7 @@ static int _lv_update_and_reload(struct logical_volume *lv, int origin_only)
r = 0;
}
- if (do_backup)
+ if (do_backup && !critical_section())
backup(vg);
return r;
6 years, 4 months
master - cleanup: remove stack tracing for ok path
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1ac7fde67b10c2bdfa3...
Commit: 1ac7fde67b10c2bdfa37d1cf3f2ce48033f27baf
Parent: b9ac1c12d0966714a918154e97864faf0a916170
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 10 13:41:45 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Nov 11 00:56:10 2017 +0100
cleanup: remove stack tracing for ok path
---
tools/toollib.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 3b89568..2898525 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -4337,7 +4337,7 @@ endvg:
/* Quit early when possible. */
if (!process_all_pvs && dm_list_empty(arg_tags) && dm_list_empty(arg_devices)) {
do_report_ret_code = 0;
- goto_out;
+ goto out;
}
log_set_report_object_name_and_id(NULL, NULL);
6 years, 4 months
master - cleanup: constify lv parameter
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b9ac1c12d0966714a91...
Commit: b9ac1c12d0966714a918154e97864faf0a916170
Parent: 05f9acdc7ff3e9968c2e2422b2cd384c74d7dbe4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Nov 8 14:24:09 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Nov 11 00:56:10 2017 +0100
cleanup: constify lv parameter
---
lib/locking/locking.c | 2 +-
lib/locking/locking.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index 2886fc4..bf39b4a 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -437,7 +437,7 @@ int suspend_lvs(struct cmd_context *cmd, struct dm_list *lvs,
* Then if the VG is clustered and the LV is not yet active (e.g. due to
* an activation filter) try activating on remote nodes.
*/
-int activate_lv_excl(struct cmd_context *cmd, struct logical_volume *lv)
+int activate_lv_excl(struct cmd_context *cmd, const struct logical_volume *lv)
{
/* Non-clustered VGs are only activated locally. */
if (!vg_is_clustered(lv->vg))
diff --git a/lib/locking/locking.h b/lib/locking/locking.h
index 2381631..d39a725 100644
--- a/lib/locking/locking.h
+++ b/lib/locking/locking.h
@@ -242,7 +242,7 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
lock_lv_vol(cmd, lv, LCK_LV_EXCLUSIVE | LCK_HOLD | LCK_REMOTE)
struct logical_volume;
-int activate_lv_excl(struct cmd_context *cmd, struct logical_volume *lv);
+int activate_lv_excl(struct cmd_context *cmd, const struct logical_volume *lv);
#define activate_lv_local(cmd, lv) \
lock_lv_vol_serially(cmd, lv, LCK_LV_ACTIVATE | LCK_HOLD | LCK_LOCAL)
6 years, 4 months
master - raid: protect raid4 activation
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=05f9acdc7ff3e9968c2...
Commit: 05f9acdc7ff3e9968c2e2422b2cd384c74d7dbe4
Parent: f0d1c8429b9d59959170cd44732d8ff1987a886a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 9 13:00:28 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Nov 11 00:56:10 2017 +0100
raid: protect raid4 activation
Move check for presence of raid4 into the right place
so there is no way how to hit activation of any LV
with raid4 on kernel which does not support it.
---
lib/metadata/lv.c | 14 --------------
lib/raid/raid.c | 24 +++++++++++++++++-------
2 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index e3815c9..e50b2bb 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -1462,7 +1462,6 @@ int lv_active_change(struct cmd_context *cmd, struct logical_volume *lv,
enum activation_change activate, int needs_exclusive)
{
const char *ay_with_mode = NULL;
- struct lv_segment *seg = first_seg(lv);
if (activate == CHANGE_ASY)
ay_with_mode = "sh";
@@ -1499,9 +1498,6 @@ deactivate:
break;
case CHANGE_ALY:
case CHANGE_AAY:
- if (!raid4_is_supported(cmd, seg->segtype))
- goto no_raid4;
-
if (needs_exclusive || _lv_is_exclusive(lv)) {
log_verbose("Activating logical volume %s exclusively locally.",
display_lvname(lv));
@@ -1516,9 +1512,6 @@ deactivate:
break;
case CHANGE_AEY:
exclusive:
- if (!raid4_is_supported(cmd, seg->segtype))
- goto no_raid4;
-
log_verbose("Activating logical volume %s exclusively.",
display_lvname(lv));
if (!activate_lv_excl(cmd, lv))
@@ -1527,9 +1520,6 @@ exclusive:
case CHANGE_ASY:
case CHANGE_AY:
default:
- if (!raid4_is_supported(cmd, seg->segtype))
- goto no_raid4;
-
if (needs_exclusive || _lv_is_exclusive(lv))
goto exclusive;
log_verbose("Activating logical volume %s.", display_lvname(lv));
@@ -1542,10 +1532,6 @@ exclusive:
log_error("Failed to unlock logical volume %s.", display_lvname(lv));
return 1;
-
-no_raid4:
- log_error("Failed to activate %s LV %s", lvseg_name(seg), display_lvname(lv));
- return 0;
}
char *lv_active_dup(struct dm_pool *mem, const struct logical_volume *lv)
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index b9f9161..5d2e1ea 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -24,6 +24,10 @@
#include "metadata.h"
#include "lv_alloc.h"
+static int _raid_target_present(struct cmd_context *cmd,
+ const struct lv_segment *seg __attribute__((unused)),
+ unsigned *attributes);
+
static void _raid_display(const struct lv_segment *seg)
{
unsigned s;
@@ -247,13 +251,19 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
int delta_disks = 0, delta_disks_minus = 0, delta_disks_plus = 0, data_offset = 0;
uint32_t s;
uint64_t flags = 0;
- uint64_t rebuilds[RAID_BITMAP_SIZE];
- uint64_t writemostly[RAID_BITMAP_SIZE];
- struct dm_tree_node_raid_params_v2 params;
-
- memset(¶ms, 0, sizeof(params));
- memset(&rebuilds, 0, sizeof(rebuilds));
- memset(&writemostly, 0, sizeof(writemostly));
+ uint64_t rebuilds[RAID_BITMAP_SIZE] = { 0 };
+ uint64_t writemostly[RAID_BITMAP_SIZE] = { 0 };
+ struct dm_tree_node_raid_params_v2 params = { 0 };
+ unsigned attrs;
+
+ if (seg_is_raid4(seg)) {
+ if (!_raid_target_present(cmd, NULL, &attrs) ||
+ !(attrs & RAID_FEATURE_RAID4)) {
+ log_error("RAID target does not support RAID4 for LV %s.",
+ display_lvname(seg->lv));
+ return 0;
+ }
+ }
if (!seg->area_count) {
log_error(INTERNAL_ERROR "_raid_add_target_line called "
6 years, 4 months
master - test: check dmsetup hides integrity encryption keys
by Ondrej Kozina
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f0d1c8429b9d5995917...
Commit: f0d1c8429b9d59959170cd44732d8ff1987a886a
Parent: 32e747dd3124a2de6b2d07e0494067dd0147932b
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Fri Nov 10 15:15:43 2017 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri Nov 10 15:23:07 2017 +0100
test: check dmsetup hides integrity encryption keys
---
test/shell/dmsetup-integrity-keys.sh | 60 ++++++++++++++++++++++++++++++++++
1 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/test/shell/dmsetup-integrity-keys.sh b/test/shell/dmsetup-integrity-keys.sh
new file mode 100644
index 0000000..6a7172f
--- /dev/null
+++ b/test/shell/dmsetup-integrity-keys.sh
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# unrelated to lvm2 daemons
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+SKIP_WITH_CLVMD=1
+SKIP_WITH_LVMETAD=1
+
+. lib/inittest
+
+INTERNAL_HASH_CRYPT="hmac(sha256)"
+INTERNAL_HASH_NOCRYPT=crc32
+JOURNAL_CRYPT="ctr(aes)"
+HEXKEY_32=0102030405060708090a0102030405060102030405060708090a010203040506
+HEXKEY2_32=0102030405060708090a010203040b060102030405060708090a010203040506
+HIDENKEY_32=0000000000000000000000000000000000000000000000000000000000000000
+
+aux target_at_least dm-integrity 1 0 0 || skip "missing dm-integrity target"
+aux target_at_least dm-zero 1 0 0 || skip "missing dm-zero target"
+
+function _teardown() {
+ aux teardown_devs_prefixed "$PREFIX"
+}
+
+trap '_teardown' EXIT
+
+dmsetup create "$PREFIX-zero" --table "0 10000 zero"
+dmsetup create "$PREFIX-integrity" --table "0 7856 integrity $DM_DEV_DIR/mapper/$PREFIX-zero 0 32 J 7 journal_sectors:88 interleave_sectors:32768 buffer_sectors:128 journal_watermark:50 commit_time:10000 internal_hash:$INTERNAL_HASH_NOCRYPT journal_crypt:$JOURNAL_CRYPT:$HEXKEY_32"
+
+str=$(dmsetup table "$PREFIX-integrity" | cut -d ' ' -f 15)
+test "$str" = "journal_crypt:$JOURNAL_CRYPT:$HIDENKEY_32"
+str=$(dmsetup table --showkeys "$PREFIX-integrity" | cut -d ' ' -f 15)
+test "$str" = "journal_crypt:$JOURNAL_CRYPT:$HEXKEY_32"
+str=$(dmsetup table "$PREFIX-integrity" | cut -d ' ' -f 14)
+test "$str" = "internal_hash:$INTERNAL_HASH_NOCRYPT"
+
+dmsetup remove "$PREFIX-integrity"
+dmsetup create "$PREFIX-integrity" --table "0 7856 integrity $DM_DEV_DIR/mapper/$PREFIX-zero 0 32 J 7 journal_sectors:88 interleave_sectors:32768 buffer_sectors:128 journal_watermark:50 commit_time:10000 internal_hash:$INTERNAL_HASH_CRYPT:$HEXKEY2_32 journal_crypt:$JOURNAL_CRYPT:$HEXKEY_32"
+
+str=$(dmsetup table "$PREFIX-integrity" | cut -d ' ' -f 15)
+test "$str" = "journal_crypt:$JOURNAL_CRYPT:$HIDENKEY_32"
+str=$(dmsetup table --showkeys "$PREFIX-integrity" | cut -d ' ' -f 15)
+test "$str" = "journal_crypt:$JOURNAL_CRYPT:$HEXKEY_32"
+str=$(dmsetup table "$PREFIX-integrity" | cut -d ' ' -f 14)
+test "$str" = "internal_hash:$INTERNAL_HASH_CRYPT:$HIDENKEY_32"
+str=$(dmsetup table --showkeys "$PREFIX-integrity" | cut -d ' ' -f 14)
+test "$str" = "internal_hash:$INTERNAL_HASH_CRYPT:$HEXKEY2_32"
+
+dmsetup remove "$PREFIX-integrity"
+dmsetup remove "$PREFIX-zero"
6 years, 4 months
master - dmsetup: hide integrity encryption keys on table output
by Ondrej Kozina
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=32e747dd3124a2de6b2...
Commit: 32e747dd3124a2de6b2d07e0494067dd0147932b
Parent: 512b2adc7773d302895d01dbc1bccfb66dd94d6a
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Fri Nov 10 13:55:04 2017 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Fri Nov 10 15:23:00 2017 +0100
dmsetup: hide integrity encryption keys on table output
---
WHATS_NEW_DM | 1 +
man/dmsetup.8_main | 6 ++--
tools/dmsetup.c | 60 ++++++++++++++++++++++++++++++++++++++-------------
3 files changed, 48 insertions(+), 19 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 71ccea7..b7f71ca 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.146 -
====================================
+ Suppress integrity encryption keys in 'table' output unless --showkeys supplied.
Version 1.02.145 - 3rd November 2017
====================================
diff --git a/man/dmsetup.8_main b/man/dmsetup.8_main
index 054746c..8317e23 100644
--- a/man/dmsetup.8_main
+++ b/man/dmsetup.8_main
@@ -842,10 +842,10 @@ Outputs the current table for the device in a format that can be fed
back in using the create or load commands.
With \fB--target\fP, only information relating to the specified target type
is displayed.
-Real encryption keys are suppressed in the table output for the crypt
-target unless the \fB--showkeys\fP parameter is supplied. Kernel key
+Real encryption keys are suppressed in the table output for crypt and integrity
+targets unless the \fB--showkeys\fP parameter is supplied. Kernel key
references prefixed with \fB:\fP are not affected by the parameter and get
-displayed always.
+displayed always (crypt target only).
With \fB--concise\fP, the output is presented concisely on a single line.
Commas then separate the name, uuid, minor device number, flags ('ro' or 'rw')
and the table (if present). Semi-colons separate devices. Backslashes escape
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index ced0311..e85680f 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -2375,6 +2375,24 @@ static void _print_string_quoted(const char *s)
}
}
+static void hide_key(char *params, const char *name)
+{
+ char *c = strstr(params, name);
+
+ if (!c)
+ return;
+
+ c += strlen(name);
+
+ /* key is optional */
+ c = strpbrk(c, " :");
+ if (!c || *c++ != ':')
+ return;
+
+ while (*c && *c != ' ')
+ *c++ = '0';
+}
+
static int _status(CMD_ARGS)
{
int r = 0;
@@ -2480,24 +2498,34 @@ static int _status(CMD_ARGS)
}
/* Next print any target-specific information */
if (target_type) {
- /* Suppress encryption key */
+ /* Suppress encryption keys */
if (!_switches[SHOWKEYS_ARG] &&
- cmdno == DM_DEVICE_TABLE &&
- !strcmp(target_type, "crypt")) {
- c = params;
- while (*c && *c != ' ')
- c++;
- if (*c)
- c++;
- /*
- * Do not suppress kernel key references prefixed
- * with colon ':'. Displaying those references is
- * harmless. crypt target supports kernel keys
- * starting with v1.15.0 (merged in kernel 4.10)
- */
- if (*c != ':')
+ cmdno == DM_DEVICE_TABLE) {
+ if (!strcmp(target_type, "crypt")) {
+ c = params;
while (*c && *c != ' ')
- *c++ = '0';
+ c++;
+ if (*c)
+ c++;
+ /*
+ * Do not suppress kernel key references prefixed
+ * with colon ':'. Displaying those references is
+ * harmless. crypt target supports kernel keys
+ * starting with v1.15.0 (merged in kernel 4.10)
+ */
+ if (*c != ':')
+ while (*c && *c != ' ')
+ *c++ = '0';
+ } else if (!strcmp(target_type, "integrity")) {
+ /*
+ * "internal_hash", "journal_crypt" and "journal_mac"
+ * params allow keys optionally in hexbyte
+ * representation.
+ */
+ hide_key(params, "internal_hash:");
+ hide_key(params, "journal_crypt:");
+ hide_key(params, "journal_mac:");
+ }
}
if (use_concise)
putchar(',');
6 years, 4 months
master - test: D-Bus test_nesting requires filter
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=512b2adc7773d302895...
Commit: 512b2adc7773d302895d01dbc1bccfb66dd94d6a
Parent: cd3b5e60a82f745030e2a976832a1490494851dc
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Nov 9 10:56:15 2017 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Nov 9 11:57:59 2017 +0100
test: D-Bus test_nesting requires filter
---
test/api/dbustest.sh | 3 +++
test/dbus/lvmdbustest.py | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/test/api/dbustest.sh b/test/api/dbustest.sh
index 5817e01..9da4fe0 100644
--- a/test/api/dbustest.sh
+++ b/test/api/dbustest.sh
@@ -18,6 +18,9 @@ SKIP_WITH_CLVMD=1
aux prepare_pvs 6
+# Required by test_nesting:
+aux extend_filter_LVMTEST
+
# We need the lvmdbusd.profile for the daemon to utilize JSON
# output
mkdir -p "$TESTDIR/etc/profile"
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 3dca9d5..0914b7a 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -1868,6 +1868,9 @@ class TestDbusService(unittest.TestCase):
def test_nesting(self):
# check to see if we handle an LV becoming a PV which has it's own
# LV
+ #
+ # NOTE: This needs an equivalent of aux extend_filter_LVMTEST
+ # when run from lvm2 testsuite. See dbustest.sh.
pv_object_path = self.objs[PV_INT][0].object_path
for i in range(0, 5):
6 years, 4 months
master - test: Rename test nothing methods
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cd3b5e60a82f745030e...
Commit: cd3b5e60a82f745030e2a976832a1490494851dc
Parent: 9958c4192766edb2b0f6cf7b963b72121c50b7ad
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Nov 9 09:52:36 2017 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Nov 9 11:31:54 2017 +0100
test: Rename test nothing methods
These two methods might be useful for debugging, but are not testing
anything.
---
test/api/python_lvm_unit.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/api/python_lvm_unit.py b/test/api/python_lvm_unit.py
index 3ffb3ad..296ca14 100755
--- a/test/api/python_lvm_unit.py
+++ b/test/api/python_lvm_unit.py
@@ -264,7 +264,7 @@ class TestLvm(unittest.TestCase):
self.assertTrue(found)
@staticmethod
- def test_pv_methods():
+ def _test_pv_methods():
with AllowedPVS() as pvs:
for p in pvs:
p.getName()
@@ -863,7 +863,7 @@ class TestLvm(unittest.TestCase):
vg.close()
@staticmethod
- def test_listing():
+ def _test_listing():
env = os.environ
6 years, 4 months
master - raid: reject message for 2-legged raid4/5 -> striped
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9958c4192766edb2b0f...
Commit: 9958c4192766edb2b0f6cf7b963b72121c50b7ad
Parent: 763db8aab02d7df551a3e8500d261ef6c9651bdb
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Wed Nov 8 18:17:26 2017 +0100
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Wed Nov 8 18:17:26 2017 +0100
raid: reject message for 2-legged raid4/5 -> striped
Commit 763db8aab02d7df551a3e8500d261ef6c9651bdb rejects 2-legged
conversions to striped/raid0 but different messages are displayed
for raid0 or striped. This commit provides the same rejection messages.
---
lib/metadata/raid_manip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 816c6d4..a904666 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6424,7 +6424,7 @@ int lv_raid_convert(struct logical_volume *lv,
stripe_size = new_stripe_size_supplied ? new_stripe_size : seg->stripe_size;
if (segtype_is_striped(new_segtype))
- new_image_count = stripes ? : seg->area_count;
+ new_image_count = stripes > 1 ? stripes : seg->area_count;
if (!_check_max_raid_devices(new_image_count))
return_0;
6 years, 4 months