Skip to contentSkip to conversation

master - lvcreate: raid0 needs default number of stripes

PATCH Heinz Mauelshagen 1 participant 1 message Jul 20, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7eb79091937d01eec51fc6a034879a6fe607231d
Commit:        7eb79091937d01eec51fc6a034879a6fe607231d
Parent:        19e652b182099ca06c678394eccd1988967dacf9
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Wed Jul 20 17:20:15 2016 +0200
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Wed Jul 20 17:20:15 2016 +0200

lvcreate: raid0 needs default number of stripes

Commit 3928c96a37941d765bf467d82502cd2aec7fd809 introduced new defaults for raid number of stripes, which may cause backwards compatibility issues with customer scripts.

Adding configurable option 'raid_stripe_all_devices' defaulting to '0' (i.e. off = new behaviour) to select the old behaviour of using all PVs in the VG or those provided on the command line.

In case any scripts rely on the old behaviour, just set 'raid_strip_all_devices = 1'.

- resolves rhbz1354650

---
 conf/example.conf.in         |    7 ++
 lib/config/config_settings.h |    5 ++
 lib/config/defaults.h        |    1 +
 tools/lvcreate.c             |  126 ++++++++++++++++++++++++-----------------
 4 files changed, 87 insertions(+), 52 deletions(-)
conf/example.conf.in +7 -0
index f7cebf9..8b79d7d 100644
@@ -472,6 +472,13 @@ allocation {
 	# Default physical extent size in KiB to use for new VGs.
 	# This configuration option has an automatic default value.
 	# physical_extent_size = 4096
+
+	# Configuration option striping across all PVs when RAID stripes are not specified.
+	# If enabled, all PVs in the VG or on the command line are used for raid0/4/5/6/10
+	# when the command does not specify the number of stripes to use.
+	#
+	# This configuration option has an automatic default value.
+	# raid_stripe_all_devices = 0
 }
 
 # Configuration section log.
lib/config/config_settings.h +5 -0
index 25914ea..8b9932e 100644
@@ -461,6 +461,11 @@ cfg(allocation_mirror_logs_require_separate_pvs_CFG, "mirror_logs_require_separa
 	"Mirror logs and images will always use different PVs.\n"
 	"The default setting changed in version 2.02.85.\n")
 
+cfg(allocation_raid_stripe_all_devices_CFG, "raid_stripe_all_devices", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ALLOCATION_STRIPE_ALL_DEVICES, vsn(2, 2, 162), NULL, 0, NULL,
+	"Stripe across all PVs when RAID stripes are not specified.\n"
+	"If enabled, all PVs in the VG or on the command line are used for raid0/4/5/6/10\n"
+	"when the command does not specify the number of stripes to use.\n")
+
 cfg(allocation_cache_pool_metadata_require_separate_pvs_CFG, "cache_pool_metadata_require_separate_pvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS, vsn(2, 2, 106), NULL, 0, NULL,
 	"Cache pool metadata and data will always use different PVs.\n")
 
lib/config/defaults.h +1 -0
index addb14f..f1f1700 100644
@@ -68,6 +68,7 @@
 #define DEFAULT_MIRROR_MAX_IMAGES 8 /* limited by kernel DM_KCOPYD_MAX_REGIONS */
 // FIXME Increase this to 64
 #define DEFAULT_RAID_MAX_IMAGES 8 /* limited by kernel failed devices bitfield in superblock (raid4/5/6 max 253) */
+#define DEFAULT_ALLOCATION_STRIPE_ALL_DEVICES 0 /* Don't stripe across all devices if not -i/--stripes given */
 
 #define DEFAULT_RAID_FAULT_POLICY "warn"
 
tools/lvcreate.c +74 -52

171 lines not on this page · raw message