summaryrefslogtreecommitdiff
path: root/convert/source-fs.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-01-30 13:41:36 +0100
committerDavid Sterba <dsterba@suse.com>2017-03-08 13:00:46 +0100
commitcf83a41a02e2f1f86f6b3c10abe0bf051a151c62 (patch)
tree202a68cecf1858722d65be9513df1fe3877185d4 /convert/source-fs.c
parent663253415f2315779c246b889e2030681ff9efae (diff)
btrfs-progs: convert: move struct initialization to the init function
The context is zeroed in convert_open_fs after and overwrites the rbtree initialization, which accidentally is the same (NULL). Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'convert/source-fs.c')
-rw-r--r--convert/source-fs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/convert/source-fs.c b/convert/source-fs.c
index f2952777..e87b861c 100644
--- a/convert/source-fs.c
+++ b/convert/source-fs.c
@@ -40,6 +40,8 @@ static int intersect_with_sb(u64 bytenr, u64 num_bytes)
void init_convert_context(struct btrfs_convert_context *cctx)
{
+ memset(cctx, 0, sizeof(*cctx));
+
cache_tree_init(&cctx->used);
cache_tree_init(&cctx->data_chunks);
cache_tree_init(&cctx->free);