Skip to contentSkip to conversation

dm-striped device sizes must be multiple of chunk-size

PATCH Joseph Yasi 4 participants 7 messages Mar 23, 2006 – Mar 29, 2006 Device mapper

lore
Share & tools
lore
#0 lore raw

Hello,

I am using the dmraid utility to detect and configure my Intel
Software Raid RAID0 array. When upgrading to 2.6.16 from 2.6.15, the system failed to boot because the device-mapper array was not built. I have traced the problem to this patch that limits dm-stripe to targets that are multiples of the chunk size. I don't know whether to consider this a problem with device-mapper or with the Intel Software Raid BIOS that built the array. Dmraid is giving me a target of 980460038 blocks with a chunk size of 256 blocks. Is this a problem with device-mapper, the dmraid utility or the raid bios? Should device-mapper handle striped targets that are not multiples of the chunk size?

Thank You,
Joe Yasi

dmesg gives these pertinent lines:
device-mapper: dm-stripe: Target length not divisible by chunk size.
device-mapper: error adding target to table.

dmsetup status
isw_caejhbcidd_Volume03: 0 976173660 linear
isw_caejhbcidd_Volume02: 0 4209030 linear
isw_caejhbcidd_Volume01: 0 64197 linear
isw_caejhbcidd_Volume0: 0 980460038 striped

dmraid -s
*** Group superset isw_caejhbcidd
--> Active Subset
name : isw_caejhbcidd_Volume0
size : 980460038
stride : 256
type : stripe
status : ok
subsets: 0
devs : 2
spares : 0

#1 lore raw
Quoted 11 lines · Joseph Yasi

I am using the dmraid utility to detect and configure my Intel
Software Raid RAID0 array. When upgrading to 2.6.16 from 2.6.15, the system failed to boot because the device-mapper array was not built. I have traced the problem to this patch that limits dm-stripe to targets that are multiples of the chunk size. I don't know whether to consider this a problem with device-mapper or with the Intel Software Raid BIOS that built the array. Dmraid is giving me a target of 980460038 blocks with a chunk size of 256 blocks. Is this a problem with device-mapper, the dmraid utility or the raid bios? Should device-mapper handle striped targets that are not multiples of the chunk size?

Hmm...I obviously didn't expect dmraid to be creating such devices.

The kernel patch that was added to 2.6.16 is definitely correct. Dm-stripe should not allow creating a device with a size that's not a multiple of the chunk-size. To do so leaves a partial chunk at the end of each device. While at first glance this might not seem like a big deal, the striping calculations in the I/O path do not handle this situation (at least, not in the way you would think it should be handled), and cause I/O errors if you try to access the end of the stripe device.

Quoted 10 lines

dmesg gives these pertinent lines:
device-mapper: dm-stripe: Target length not divisible by chunk size.
device-mapper: error adding target to table.

dmsetup status
isw_caejhbcidd_Volume03: 0 976173660 linear
isw_caejhbcidd_Volume02: 0 4209030 linear
isw_caejhbcidd_Volume01: 0 64197 linear
isw_caejhbcidd_Volume0: 0 980460038 striped

Quoted 11 lines

dmraid -s
*** Group superset isw_caejhbcidd
--> Active Subset
name : isw_caejhbcidd_Volume0
size : 980460038
stride : 256
type : stripe
status : ok
subsets: 0
devs : 2
spares : 0

In your example, your stripe device is 980460038 sectors, with a 256 sector chunk-size.This means the stripe device has 3829922 chunks, with 6 sectors left over (3 on each of the two devices, presumably). I would think that the BIOS intends that these last 3 sectors on each device should be striped with an effective chunk-size of 3 sectors. To do this, dmraid should set up a device with two targets, one with a chunk-size of 256, and one with a chunk-size of 3. The map would look something like:

0 980460032 striped 2 256 /dev/hda 0 /dev/hdb 0 980460032 6 striped 2 3 /dev/hda /dev/hdb 490230016

Unfortunately, this doesn't work either, because the chunk-size must be a power-of-2. So...since we know the second target in the map really represents only one "stripe", we could treat them as a concatenation of independent linear targets. So we end up with a map like this:

0 980460032 striped 2 256 /dev/hda 0 /dev/hdb 0
980460032 3 linear /dev/hda 490230016
980460032 3 linear /dev/hdb 490230016

I'm thinking that this mapping would do what the BIOS is actually intending. It ought to be relatively straight-forward to recognize this situation in dmraid and set up a mapping similar to the one above.

Signature · 4 lines
Kevin Corry
[email protected]
http://www.ibm.com/linux/
http://evms.sourceforge.net/
#2 lore raw
Quoted 5 lines · Kevin Corry <kevcorry <at> us.ibm.com> writes:

I'm thinking that this mapping would do what the BIOS is actually intending. It ought to be relatively straight-forward to recognize this situation in dmraid and set up a mapping similar to the one above.

I have the same problem. How would you resolve this?

Dwaine

#3 lore raw

Dwaine,

can you please send me your metadata for refernence as well so that I can confirm that my fix is good for bz #186842 ?

Thanks,
Heinz

Quoted 14 lines · Dwaine Garden
Quoted 5 lines · Kevin Corry <kevcorry <at> us.ibm.com> writes:

I'm thinking that this mapping would do what the BIOS is actually intending. It ought to be relatively straight-forward to recognize this situation in dmraid and set up a mapping similar to the one above.

I have the same problem. How would you resolve this?

Dwaine

Quoted 4 lines

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
Storage Development                               56242 Marienrachdorf
                                                  Germany
[email protected]                            PHONE +49  171 7803392
                                                  FAX   +49 2626 924446

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
In reply to Kevin Corry

Kevin,

I'm not convinced that a more complex mapping is needed.

Haven't seen the reported case so far with a lot of RAID0 metadata samples users provided to me for various ATARAID flavours.

The RAID device size (which is smaller than the underlying device) needs to be divisable w/o rest by the stride size IMO.

Guess I'm missing something about setting up the device size (rd->sectors) correctly in the metadata format handler.

Investigating...

Heinz

Quoted 61 lines · Kevin Corry
Quoted 11 lines · Joseph Yasi

I am using the dmraid utility to detect and configure my Intel
Software Raid RAID0 array. When upgrading to 2.6.16 from 2.6.15, the system failed to boot because the device-mapper array was not built. I have traced the problem to this patch that limits dm-stripe to targets that are multiples of the chunk size. I don't know whether to consider this a problem with device-mapper or with the Intel Software Raid BIOS that built the array. Dmraid is giving me a target of 980460038 blocks with a chunk size of 256 blocks. Is this a problem with device-mapper, the dmraid utility or the raid bios? Should device-mapper handle striped targets that are not multiples of the chunk size?

Hmm...I obviously didn't expect dmraid to be creating such devices.

The kernel patch that was added to 2.6.16 is definitely correct. Dm-stripe should not allow creating a device with a size that's not a multiple of the chunk-size. To do so leaves a partial chunk at the end of each device. While at first glance this might not seem like a big deal, the striping calculations in the I/O path do not handle this situation (at least, not in the way you would think it should be handled), and cause I/O errors if you try to access the end of the stripe device.

Quoted 10 lines

dmesg gives these pertinent lines:
device-mapper: dm-stripe: Target length not divisible by chunk size.
device-mapper: error adding target to table.

dmsetup status
isw_caejhbcidd_Volume03: 0 976173660 linear
isw_caejhbcidd_Volume02: 0 4209030 linear
isw_caejhbcidd_Volume01: 0 64197 linear
isw_caejhbcidd_Volume0: 0 980460038 striped

Quoted 11 lines

dmraid -s
*** Group superset isw_caejhbcidd
--> Active Subset
name : isw_caejhbcidd_Volume0
size : 980460038
stride : 256
type : stripe
status : ok
subsets: 0
devs : 2
spares : 0

In your example, your stripe device is 980460038 sectors, with a 256 sector chunk-size.This means the stripe device has 3829922 chunks, with 6 sectors left over (3 on each of the two devices, presumably). I would think that the BIOS intends that these last 3 sectors on each device should be striped with an effective chunk-size of 3 sectors. To do this, dmraid should set up a device with two targets, one with a chunk-size of 256, and one with a chunk-size of 3. The map would look something like:

0 980460032 striped 2 256 /dev/hda 0 /dev/hdb 0 980460032 6 striped 2 3 /dev/hda /dev/hdb 490230016

Unfortunately, this doesn't work either, because the chunk-size must be a power-of-2. So...since we know the second target in the map really represents only one "stripe", we could treat them as a concatenation of independent linear targets. So we end up with a map like this:

Quoted 18 lines

0 980460032 striped 2 256 /dev/hda 0 /dev/hdb 0
980460032 3 linear /dev/hda 490230016
980460032 3 linear /dev/hdb 490230016

I'm thinking that this mapping would do what the BIOS is actually intending. It ought to be relatively straight-forward to recognize this situation in dmraid and set up a mapping similar to the one above.

Signature · 9 lines
Kevin Corry
[email protected]
http://www.ibm.com/linux/
http://evms.sourceforge.net/

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
Storage Development                               56242 Marienrachdorf
                                                  Germany
[email protected]                            PHONE +49  171 7803392
                                                  FAX   +49 2626 924446

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw

Kevin,

got a fix in a central location (activate.c) which looks like it cuts the issue. Just waiting for metadata samples of reporters to get in to confirm.

Heinz

Quoted 11 lines · Heinz Mauelshagen

Kevin,

I'm not convinced that a more complex mapping is needed.

Haven't seen the reported case so far with a lot of RAID0 metadata samples users provided to me for various ATARAID flavours.

The RAID device size (which is smaller than the underlying device) needs to be divisable w/o rest by the stride size IMO.

Quoted 87 lines

Guess I'm missing something about setting up the device size (rd->sectors) correctly in the metadata format handler.

Investigating...

Heinz

Quoted 79 lines · Kevin Corry
Quoted 11 lines · Joseph Yasi

I am using the dmraid utility to detect and configure my Intel
Software Raid RAID0 array. When upgrading to 2.6.16 from 2.6.15, the system failed to boot because the device-mapper array was not built. I have traced the problem to this patch that limits dm-stripe to targets that are multiples of the chunk size. I don't know whether to consider this a problem with device-mapper or with the Intel Software Raid BIOS that built the array. Dmraid is giving me a target of 980460038 blocks with a chunk size of 256 blocks. Is this a problem with device-mapper, the dmraid utility or the raid bios? Should device-mapper handle striped targets that are not multiples of the chunk size?

Hmm...I obviously didn't expect dmraid to be creating such devices.

The kernel patch that was added to 2.6.16 is definitely correct. Dm-stripe should not allow creating a device with a size that's not a multiple of the chunk-size. To do so leaves a partial chunk at the end of each device. While at first glance this might not seem like a big deal, the striping calculations in the I/O path do not handle this situation (at least, not in the way you would think it should be handled), and cause I/O errors if you try to access the end of the stripe device.

Quoted 10 lines

dmesg gives these pertinent lines:
device-mapper: dm-stripe: Target length not divisible by chunk size.
device-mapper: error adding target to table.

dmsetup status
isw_caejhbcidd_Volume03: 0 976173660 linear
isw_caejhbcidd_Volume02: 0 4209030 linear
isw_caejhbcidd_Volume01: 0 64197 linear
isw_caejhbcidd_Volume0: 0 980460038 striped

Quoted 11 lines

dmraid -s
*** Group superset isw_caejhbcidd
--> Active Subset
name : isw_caejhbcidd_Volume0
size : 980460038
stride : 256
type : stripe
status : ok
subsets: 0
devs : 2
spares : 0

In your example, your stripe device is 980460038 sectors, with a 256 sector chunk-size.This means the stripe device has 3829922 chunks, with 6 sectors left over (3 on each of the two devices, presumably). I would think that the BIOS intends that these last 3 sectors on each device should be striped with an effective chunk-size of 3 sectors. To do this, dmraid should set up a device with two targets, one with a chunk-size of 256, and one with a chunk-size of 3. The map would look something like:

0 980460032 striped 2 256 /dev/hda 0 /dev/hdb 0 980460032 6 striped 2 3 /dev/hda /dev/hdb 490230016

Unfortunately, this doesn't work either, because the chunk-size must be a power-of-2. So...since we know the second target in the map really represents only one "stripe", we could treat them as a concatenation of independent linear targets. So we end up with a map like this:

0 980460032 striped 2 256 /dev/hda 0 /dev/hdb 0
980460032 3 linear /dev/hda 490230016
980460032 3 linear /dev/hdb 490230016

I'm thinking that this mapping would do what the BIOS is actually intending. It ought to be relatively straight-forward to recognize this situation in dmraid and set up a mapping similar to the one above.

Signature · 9 lines
Kevin Corry
[email protected]
http://www.ibm.com/linux/
http://evms.sourceforge.net/

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
Storage Development                               56242 Marienrachdorf
                                                  Germany
[email protected]                            PHONE +49  171 7803392
                                                  FAX   +49 2626 924446

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

#6 lore raw
In reply to Joseph Yasi

Joseph,

can you send me the tar-archive of your metadata

dmraid -rD
tar jcvf isw-Joseph_Yasi-raid0.tar.bz2 *.{dat,size,offset)

for reference, please.

Heinz

Quoted 39 lines · Joseph Yasi

Hello,

I am using the dmraid utility to detect and configure my Intel
Software Raid RAID0 array. When upgrading to 2.6.16 from 2.6.15, the system failed to boot because the device-mapper array was not built. I have traced the problem to this patch that limits dm-stripe to targets that are multiples of the chunk size. I don't know whether to consider this a problem with device-mapper or with the Intel Software Raid BIOS that built the array. Dmraid is giving me a target of 980460038 blocks with a chunk size of 256 blocks. Is this a problem with device-mapper, the dmraid utility or the raid bios? Should device-mapper handle striped targets that are not multiples of the chunk size?

Thank You,
Joe Yasi

dmesg gives these pertinent lines:
device-mapper: dm-stripe: Target length not divisible by chunk size.
device-mapper: error adding target to table.

dmsetup status
isw_caejhbcidd_Volume03: 0 976173660 linear
isw_caejhbcidd_Volume02: 0 4209030 linear
isw_caejhbcidd_Volume01: 0 64197 linear
isw_caejhbcidd_Volume0: 0 980460038 striped

dmraid -s
*** Group superset isw_caejhbcidd
--> Active Subset
name : isw_caejhbcidd_Volume0
size : 980460038
stride : 256
type : stripe
status : ok
subsets: 0
devs : 2
spares : 0

Quoted 4 lines

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
Storage Development                               56242 Marienrachdorf
                                                  Germany
[email protected]                            PHONE +49  171 7803392
                                                  FAX   +49 2626 924446

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-