]> git.baikalelectronics.ru Git - kernel.git/commit
dm stripe: avoid divide by zero with invalid stripe count
authorNikanth Karthikesan <knikanth@suse.de>
Tue, 16 Feb 2010 18:42:47 +0000 (18:42 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Tue, 16 Feb 2010 18:42:47 +0000 (18:42 +0000)
commit437187d10c4d827c3b2159e0d81f3acd36b15524
treeaa102797cde7b10623eefbeee493c36fdf2bdfe3
parent6fba9e49cc1a2deadd56565791199bcd58cda8ff
dm stripe: avoid divide by zero with invalid stripe count

If a table containing zero as stripe count is passed into stripe_ctr
the code attempts to divide by zero.

This patch changes DM_TABLE_LOAD to return -EINVAL if the stripe count
is zero.

We now get the following error messages:
  device-mapper: table: 253:0: striped: Invalid stripe count
  device-mapper: ioctl: error adding target to table

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-stripe.c