[sheepdog] [PATCH] sheep/lib: fix coredump from dump_btree()

Liu Yuan namei.unix at gmail.com
Mon Jan 20 14:24:20 CET 2014


On Mon, Jan 20, 2014 at 08:52:08PM +0800, Robin Dong wrote:
> From: Robin Dong <sanbai at taobao.com>
> 
> After running ./configure with "--enable-debug", the dog will coredumps when
> running test case 016. The reason is that the function dump_btree() could only
> be called when the type of sd_inode is B-tree.
> 
> Signed-off-by: Robin Dong <sanbai at taobao.com>
> Reported-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> ---
>  lib/sd_inode.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/sd_inode.c b/lib/sd_inode.c
> index da3182e..f058582 100644
> --- a/lib/sd_inode.c
> +++ b/lib/sd_inode.c
> @@ -614,7 +614,8 @@ void sd_inode_set_vid(write_node_fn writer, read_node_fn reader,
>  out:
>  	if (path.p_ext_header)
>  		free(path.p_ext_header);
> -	dump_btree(reader, inode);
> +	if (inode->store_policy != 0)
> +		dump_btree(reader, inode);
>  }
>  
>  /*
> -- 
> 1.7.12.4
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog

Applied thanks

Yuan



More information about the sheepdog mailing list