[sheepdog] [PATCH v1] using xmalloc() to allocate sd_inode instead of using memory on stack

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Mar 5 06:28:01 CET 2014


At Tue,  4 Mar 2014 18:01:44 +0800,
Robin Dong wrote:
> diff --git a/dog/vdi.c b/dog/vdi.c
> index 09a87b2..4708a95 100644
> --- a/dog/vdi.c
> +++ b/dog/vdi.c
> @@ -2153,18 +2153,19 @@ out:
>  
>  static int vid_to_name_tag(uint32_t vid, char *name, char *tag)
>  {
> -	struct sd_inode inode;
> +	struct sd_inode *inode = xmalloc(sizeof(*inode));

Allocating only SD_INODE_HEADER_SIZE would be okay. Other part looks
good to me.

Thanks,
Hitoshi



More information about the sheepdog mailing list