[sheepdog] [PATCH] dog: fix improper typed 'ret' in 'vdi create'
Hitoshi Mitake
mitake.hitoshi at gmail.com
Wed Jan 22 01:18:07 CET 2014
At Tue, 21 Jan 2014 21:49:00 +0800,
Liu Yuan wrote:
>
> 'ret' is unsigned then never get < 0 even in error case, so for a wrong size, we
> will proceed to create an invalid vdi.
>
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
> dog/vdi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Looks good to me.
Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Thanks,
Hitoshi
>
> diff --git a/dog/vdi.c b/dog/vdi.c
> index 1afb37e..37b8ea5 100644
> --- a/dog/vdi.c
> +++ b/dog/vdi.c
> @@ -596,8 +596,9 @@ static int vdi_create(int argc, char **argv)
> uint64_t size;
> uint32_t vid;
> uint64_t oid;
> - uint32_t idx, max_idx, ret, nr_copies = vdi_cmd_data.nr_copies;
> + uint32_t idx, max_idx, nr_copies = vdi_cmd_data.nr_copies;
> struct sd_inode *inode = NULL;
> + int ret;
>
> if (!argv[optind]) {
> sd_err("Please specify the VDI size");
> --
> 1.8.1.2
>
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog
More information about the sheepdog
mailing list