btrfs-progs: Initialize btrfs_path before use
PATCH 1/1 btrfs-progs: Initialize btrfs_path before use
From: Goldwyn Rodrigues <[email protected]>
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
cmds-check.c +1 -0
@@ -7541,6 +7541,7 @@ static int record_orphan_data_extents(struct btrfs_fs_info *fs_info, key.objectid = dback->owner; key.type =BTRFS_EXTENT_DATA_KEY ; key.offset = dback->offset; +btrfs_init_path (path); ret =btrfs_search_slot (NULL , dest_root, &key, path,0 ,0 );/*
Quoted 12 lines · Goldwyn Rodrigues
From: Goldwyn Rodrigues <[email protected]>
While performing an fsck, an assertion failure occurs because of reusing path in a loop. ctree.c:1112:
btrfs_search_slot: Warning: assertionp->nodes[0] != NULLfailed, value 0Signed-off-by Goldwyn Rodrigues <[email protected]>cmds-check.c +0
-0
cmds-check.c static int record_orphan_data_extents(struct btrfs_fs_info *fs_info, · line 7544
Quoted 4 lines
cmds-check.c +1
-0@@ -7541,6 +7541,7 @@ static int record_orphan_data_extents(struct btrfs_fs_info *fs_info, key.objectid = dback->owner; key.type =BTRFS_EXTENT_DATA_KEY ; key.offset = dback->offset; +btrfs_init_path (path);
Hi Goldwyn,
You want to call btrfs_release_path(), otherwise you leak memory. And it would be better placed before the 'continue' statement.
thanks
Quoted 7 lines
cmds-check.c +0
-1ret =btrfs_search_slot (NULL , dest_root, &key, path,0 ,0 );/* -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 5 lines
Filipe David Manana, "People will forget what you said, people will forget what you did, but people will never forget how you made them feel."
Quoted 13 lines · Goldwyn Rodrigues
From: Goldwyn Rodrigues <[email protected]>
While performing an fsck, an assertion failure occurs because of reusing path in a loop. ctree.c:1112:
btrfs_search_slot: Warning: assertionp->nodes[0] != NULLfailed, value 0Signed-off-by Goldwyn Rodrigues <[email protected]>cmds-check.c +0
-0
cmds-check.c static int record_orphan_data_extents(struct btrfs_fs_info *fs_info, · line 7547
Quoted 7 lines
cmds-check.c +1
-0@@ -7541,6 +7541,7 @@ static int record_orphan_data_extents(struct btrfs_fs_info *fs_info, key.objectid = dback->owner; key.type =BTRFS_EXTENT_DATA_KEY ; key.offset = dback->offset; +btrfs_init_path (path); ret =btrfs_search_slot (NULL , dest_root, &key, path,0 ,0 );/*
This is an incorrect fix. Please ignore. I shall send the correct fix shortly. It should be release_path() instead.
Signature · 1 line
Goldwyn