From: NeilBrown Date: Mon, 25 May 2009 23:41:17 +0000 (+1000) Subject: md: improve errno return when setting array_size X-Git-Tag: upstream/snapshot3+hdmi~18784^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b69c83924396ad1eda36fdd267c9d2f360f5555;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git md: improve errno return when setting array_size Instead of always returns EINVAL if anything goes wrong when setting the array size, add the option of E2BIG if the size requested is too large. This makes it easier for user-space to be sure what went wrong. Signed-off-by: NeilBrown --- diff --git a/drivers/md/md.c b/drivers/md/md.c index aa79d55..58e0b02 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -3683,7 +3683,7 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len) if (strict_blocks_to_sectors(buf, §ors) < 0) return -EINVAL; if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors) - return -EINVAL; + return -E2BIG; mddev->external_size = 1; }