FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

LinkBack Thread Tools
Old 06-19-2012, 12:57 AM
Mikulas Patocka
Default dm-stripe: fix size test

dm-stripe: fix size test

dm-stripe is supposed to test that all the stripes are fully used.
It tests that the number of sectors in the target si divisible by
chunk size and the number of stripes.

However, this check is not sufficient:
For example, suppose that we have target length 30 sectors and the
device consists of 6 stripes, each stripe with 15 sectors.

30 is divisible by both 6 and 15, so the test passes, but the stripes
are not fully used --- only the first two stripes are used.

We must actually test that the number of sectors is divisible by the
chunk size multiplied by the number of stripes.

This patch fixes the test --- it checks that device length is divisible
by the chunk size --- and checks that the resulting quotient is
divisible by the number of stripes (which is equivalent to testing if
device length is divisible by chunk_size * stripes).

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

drivers/md/dm-stripe.c | 1 -
1 file changed, 1 deletion(-)

Index: linux-3.4.3-fast/drivers/md/dm-stripe.c
================================================== =================
--- linux-3.4.3-fast.orig/drivers/md/dm-stripe.c 2012-06-19 02:42:05.000000000 +0200
+++ linux-3.4.3-fast/drivers/md/dm-stripe.c 2012-06-19 02:42:23.000000000 +0200
@@ -125,7 +125,6 @@ static int stripe_ctr(struct dm_target *
return -EINVAL;

- width = ti->len;
if (sector_div(width, stripes)) {
ti->error = "Target length not divisible by "
"number of stripes";

dm-devel mailing list

Thread Tools

All times are GMT. The time now is 07:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org