aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/linear.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index b1eebf88c20..a58a19e859c 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -157,6 +157,8 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
min_spacing = conf->array_sectors / 2;
sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *));
+ if (min_spacing == 0)
+ min_spacing = 1;
/* min_spacing is the minimum spacing that will fit the hash
* table in one PAGE. This may be much smaller than needed.