> +if (volumeInfo.capacity < length) {
> +vshError(ctl, _("lenth parameter is bigger than volume %s
> capacity"), name);
> +goto cleanup;
> +}
> +
> +if (volumeInfo.capacity < fileLen + offset) {
> +vshError(ctl, _("file is bigger than volume %s capacity"),
The current command 'vol-upload' is not checking if the volume accepts
a file bigger than its capacity. It can cause an interrupt of the
upload stream. This commit adds a check that fails before starting to
send new file to volume if the file is bigger.
Resolves:
From: Chen Hanxiao
Provide more details related to the requirement that setting one
of the values requires setting all of them.
Signed-off-by: Chen Hanxiao
---
v3:
description updated follow John's comments
v2:
fix a typo