]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] dm: stripe width fix
authorAndrew Morton <akpm@osdl.org>
Fri, 12 Mar 2004 00:14:23 +0000 (16:14 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 12 Mar 2004 00:14:23 +0000 (16:14 -0800)
dm-stripe.c: The stripe width must be at least the page size.

drivers/md/dm-stripe.c

index 70b5553fc09a65dce7bea5c7c85ed380df37a5cd..ce6da00c82a06f76384326d937467a209ec9613f 100644 (file)
@@ -97,7 +97,8 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        /*
         * chunk_size is a power of two
         */
-       if (!chunk_size || (chunk_size & (chunk_size - 1))) {
+       if (!chunk_size || (chunk_size & (chunk_size - 1)) ||
+           (chunk_size < (PAGE_SIZE >> SECTOR_SHIFT))) {
                ti->error = "dm-stripe: Invalid chunk size";
                return -EINVAL;
        }