btrfs-progs: handle btfs_del_items() failure in truncate_free_ino_items()

Do proper error handling like in the rest of the function.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2024-03-15 00:07:40 +01:00
parent 76c49eb686
commit bb12921b8a

View File

@ -542,7 +542,11 @@ int truncate_free_ino_items(struct btrfs_root *root)
}
ret = btrfs_del_item(trans, root, &path);
BUG_ON(ret);
if (ret < 0) {
btrfs_abort_transaction(trans, ret);
btrfs_release_path(&path);
goto out;
}
btrfs_release_path(&path);
}