[dm-devel] [PATCH] dm-stripe: remove minimum stripe size

Mikulas Patocka mpatocka at redhat.com
Mon Jun 18 13:23:58 UTC 2012


dm-stripe: remove minimum stripe size

There is no technical limitation in device mapper that would prevent the
dm-stripe target from using a stripe size smaller than page size.

This patch removes the limit and makes stripe volumes portable across
architectures with different page size.

The patch also makes it reject stripe sizes that do not fit to 32 bits.
(previously the upper bits were truncated)

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

---
 drivers/md/dm-stripe.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-3.4.2-fast/drivers/md/dm-stripe.c
===================================================================
--- linux-3.4.2-fast.orig/drivers/md/dm-stripe.c	2012-06-18 14:52:22.000000000 +0200
+++ linux-3.4.2-fast/drivers/md/dm-stripe.c	2012-06-18 15:07:39.000000000 +0200
@@ -96,7 +96,7 @@ static int stripe_ctr(struct dm_target *
 	struct stripe_c *sc;
 	sector_t width;
 	uint32_t stripes;
-	uint32_t chunk_size;
+	unsigned long chunk_size;
 	char *end;
 	int r;
 	unsigned int i;
@@ -113,7 +113,7 @@ static int stripe_ctr(struct dm_target *
 	}
 
 	chunk_size = simple_strtoul(argv[1], &end, 10);
-	if (*end || (chunk_size < (PAGE_SIZE >> SECTOR_SHIFT))) {
+	if (*end || !chunk_size || chunk_size != (uint32_t)chunk_size) {
 		ti->error = "Invalid chunk_size";
 		return -EINVAL;
 	}




More information about the dm-devel mailing list