提交 2b69c839 编写于 作者: N NeilBrown

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: NNeilBrown <neilb@suse.de>
上级 62e1e389
...@@ -3683,7 +3683,7 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len) ...@@ -3683,7 +3683,7 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len)
if (strict_blocks_to_sectors(buf, &sectors) < 0) if (strict_blocks_to_sectors(buf, &sectors) < 0)
return -EINVAL; return -EINVAL;
if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors) if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors)
return -EINVAL; return -E2BIG;
mddev->external_size = 1; mddev->external_size = 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册