summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-08-18 00:45:12 +0200
committerHeinz Mauelshagen <heinzm@redhat.com>2016-08-18 00:45:12 +0200
commitc6d7cd1489935653371ccdc81f02e18ea13cea4b (patch)
tree8f9fcc786b2a02c1b4bacf02cf1a500947392783
parenteec8bd228cf778d9773f9cbbccc2859ef2f95cf9 (diff)
downloadlvm2-dev-lvmguy-raid_tiny_extent_size.tar.gz
metadata: adjust extents_round_to_boundary(); remove pagesize check inv lvcreate.cdev-lvmguy-raid_tiny_extent_size
-rw-r--r--lib/metadata/lv_manip.c5
-rw-r--r--tools/lvcreate.c7
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index f3f1d24a2..f717a38a3 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -895,7 +895,7 @@ uint32_t extents_round_to_boundary(struct volume_group *vg,
if (ensure_raid_min) {
/* Require multiples of 64 KiB to not fail in kernel RAID page size IO */
- if ((new_extents * vg->extent_size / (stripes ?: 1)) % RAID_ALLOC_CHUNK_SECTORS)
+ if ((new_extents * vg->extent_size) % ((stripes ?: 1) * RAID_ALLOC_CHUNK_SECTORS))
extend ? new_extents++ : new_extents--;
else
ensure_raid_min = 0;
@@ -3959,8 +3959,7 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
#define RAID_HEADER_SIZE (2 * 4096) /* dm-raid superblock and bitmap superblock */
static uint32_t _max_raid_extents(struct logical_volume *lv)
{
- uint32_t r;
- uint64_t mlv_sectors, max_image_size;
+ uint64_t max_image_size;
uint64_t mlv_bytes; /* dm-raid superblock and bitmap superblock */
struct lv_segment *seg = first_seg(lv);
struct logical_volume *mlv;
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index a389d7952..ccd07f054 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1255,17 +1255,10 @@ static int _check_raid_parameters(struct volume_group *vg,
struct lvcreate_cmdline_params *lcp)
{
unsigned devs = lcp->pv_count ? : dm_list_size(&vg->pvs);
- uint64_t page_sectors = lvm_getpagesize() >> SECTOR_SHIFT;
struct cmd_context *cmd = vg->cmd;
int old_stripes = !arg_is_set(cmd, stripes_ARG) &&
find_config_tree_bool(cmd, allocation_raid_stripe_all_devices_CFG, NULL);
- if (vg->extent_size < page_sectors) {
- log_error("Unable to create RAID LV: requires minimum VG extent size %s",
- display_size(vg->cmd, page_sectors));
- return 0;
- }
-
/*
* If we requested the previous behaviour by setting
* "allocation/raid_stripe_all_devices = 1" and the