In repair_extent_data_item(), path is not be released if some
errors occurs which causes extent buffer leak.
So release path in end of the function.
Signed-off-by: Su Yue <suy.fnst@xxxxxxxxxxxxxx>
---
cmds-check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index e746ee7b281d..3a72f8e3877d 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -11974,7 +11974,6 @@ static int repair_extent_data_item(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(eb);
ret = btrfs_update_block_group(trans, extent_root, disk_bytenr,
num_bytes, 1, 0);
- btrfs_release_path(&path);
}
if (nrefs->full_backref[0])
@@ -11998,6 +11997,7 @@ static int repair_extent_data_item(struct btrfs_trans_handle *trans,
err &= ~BACKREF_MISSING;
out:
+ btrfs_release_path(&path);
if (ret)
error("can't repair root %llu extent data item[%llu %llu]",
root->objectid, disk_bytenr, num_bytes);
--
2.15.0
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html