btrfs-progs: check: release path after usage
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Mon, 24 Oct 2016 15:18:14 +0000 (10:18 -0500)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Oct 2016 12:31:06 +0000 (14:31 +0200)
While performing an fsck, an assertion failure occurs because of reusing path in a loop.
ctree.c:1112: btrfs_search_slot: Warning: assertion `p->nodes[0] != NULL` failed, value 0

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c

index 907d60c..7718c7b 100644 (file)
@@ -7544,6 +7544,7 @@ static int record_orphan_data_extents(struct btrfs_fs_info *fs_info,
                key.offset = dback->offset;
 
                ret = btrfs_search_slot(NULL, dest_root, &key, path, 0, 0);
+               btrfs_release_path(path);
                /*
                 * For ret < 0, it's OK since the fs-tree may be corrupted,
                 * we need to record it for inode/file extent rebuild.