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

Robin Dong robin.k.dong at gmail.com
Mon Jan 20 13:52:08 CET 2014


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




More information about the sheepdog mailing list