diff options
Diffstat (limited to 'drivers/md/faulty.c')
-rw-r--r-- | drivers/md/faulty.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c index 18793c137278..d76c87f2a831 100644 --- a/drivers/md/faulty.c +++ b/drivers/md/faulty.c | |||
@@ -283,6 +283,17 @@ static int reconfig(mddev_t *mddev, int layout, int chunk_size) | |||
283 | return 0; | 283 | return 0; |
284 | } | 284 | } |
285 | 285 | ||
286 | static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks) | ||
287 | { | ||
288 | WARN_ONCE(raid_disks, | ||
289 | "%s does not support generic reshape\n", __func__); | ||
290 | |||
291 | if (sectors == 0) | ||
292 | return mddev->dev_sectors; | ||
293 | |||
294 | return sectors; | ||
295 | } | ||
296 | |||
286 | static int run(mddev_t *mddev) | 297 | static int run(mddev_t *mddev) |
287 | { | 298 | { |
288 | mdk_rdev_t *rdev; | 299 | mdk_rdev_t *rdev; |
@@ -301,7 +312,7 @@ static int run(mddev_t *mddev) | |||
301 | list_for_each_entry(rdev, &mddev->disks, same_set) | 312 | list_for_each_entry(rdev, &mddev->disks, same_set) |
302 | conf->rdev = rdev; | 313 | conf->rdev = rdev; |
303 | 314 | ||
304 | mddev->array_sectors = mddev->dev_sectors; | 315 | mddev->array_sectors = faulty_size(mddev, 0, 0); |
305 | mddev->private = conf; | 316 | mddev->private = conf; |
306 | 317 | ||
307 | reconfig(mddev, mddev->layout, -1); | 318 | reconfig(mddev, mddev->layout, -1); |
@@ -328,6 +339,7 @@ static struct mdk_personality faulty_personality = | |||
328 | .stop = stop, | 339 | .stop = stop, |
329 | .status = status, | 340 | .status = status, |
330 | .reconfig = reconfig, | 341 | .reconfig = reconfig, |
342 | .size = faulty_size, | ||
331 | }; | 343 | }; |
332 | 344 | ||
333 | static int __init raid_init(void) | 345 | static int __init raid_init(void) |