]> git.baikalelectronics.ru Git - kernel.git/commit
dm stripe: fix size test
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 27 Jul 2012 14:08:00 +0000 (15:08 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Fri, 27 Jul 2012 14:08:00 +0000 (15:08 +0100)
commitb1b04732409989c27cfcc2644bcdc7b7c4e84a18
tree72efcd3104d4eab2d420626b98264dd670343fd0
parent53b08cf3a6ef867c25ea69e3729ee0e686e6bac1
dm stripe: fix size test

dm-stripe is supposed to ensure that all the space allocated to the
stripes is fully used and that all stripes are the same size.  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).

Previously, the code only tested that the number of sectors in the target
was divisible by each of the chunk size and the number of stripes
separately, which could leave entire stripes unused.

(A setup that genuinely needs some stripes to be shorter than others
can be created by concatenating striped targets.)

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Documentation/device-mapper/striped.txt
drivers/md/dm-stripe.c