linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / md / dm-stripe.c
index 16acecc..697aaca 100644 (file)
@@ -103,9 +103,15 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
                return -EINVAL;
        }
 
+       if (((uint32_t)ti->len) & (chunk_size - 1)) {
+               ti->error = "dm-stripe: Target length not divisible by "
+                   "chunk size";
+               return -EINVAL;
+       }
+
        width = ti->len;
        if (sector_div(width, stripes)) {
-               ti->error = "dm-stripe: Target length not divisable by "
+               ti->error = "dm-stripe: Target length not divisible by "
                    "number of stripes";
                return -EINVAL;
        }
@@ -188,7 +194,6 @@ static int stripe_status(struct dm_target *ti,
        struct stripe_c *sc = (struct stripe_c *) ti->private;
        unsigned int sz = 0;
        unsigned int i;
-       char buffer[32];
 
        switch (type) {
        case STATUSTYPE_INFO:
@@ -197,11 +202,9 @@ static int stripe_status(struct dm_target *ti,
 
        case STATUSTYPE_TABLE:
                DMEMIT("%d " SECTOR_FORMAT, sc->stripes, sc->chunk_mask + 1);
-               for (i = 0; i < sc->stripes; i++) {
-                       format_dev_t(buffer, sc->stripe[i].dev->bdev->bd_dev);
-                       DMEMIT(" %s " SECTOR_FORMAT, buffer,
+               for (i = 0; i < sc->stripes; i++)
+                       DMEMIT(" %s " SECTOR_FORMAT, sc->stripe[i].dev->name,
                               sc->stripe[i].physical_start);
-               }
                break;
        }
        return 0;