Remove the OSTREE_MAX_RECURSION limit on metadata depth

This was making it impossible to pull or mirror a large ostree repo, and
according to Colin is no longer necessary. It works fine with a test
against a repo with 2741 commit and 451468 objects in it.

Closes: #899

Closes: #904
Approved by: jlebon
This commit is contained in:
Brian C. Lane 2017-06-02 08:30:43 -07:00 committed by Atomic Bot
parent cad42d9601
commit c651982929
3 changed files with 1 additions and 19 deletions

View File

@ -89,7 +89,6 @@ OSTREE_VERSION_HEX
<FILE>ostree-core</FILE>
OSTREE_MAX_METADATA_SIZE
OSTREE_MAX_METADATA_WARN_SIZE
OSTREE_MAX_RECURSION
OstreeObjectType
OSTREE_OBJECT_TYPE_IS_META
OSTREE_OBJECT_TYPE_LAST

View File

@ -44,13 +44,6 @@ G_BEGIN_DECLS
*/
#define OSTREE_MAX_METADATA_WARN_SIZE (7 * 1024 * 1024)
/**
* OSTREE_MAX_RECURSION:
*
* Maximum depth of metadata.
*/
#define OSTREE_MAX_RECURSION (256)
/**
* OSTREE_SHA256_DIGEST_LEN:
*

View File

@ -152,7 +152,7 @@ typedef struct {
guchar csum[OSTREE_SHA256_DIGEST_LEN];
char *path;
OstreeObjectType objtype;
guint recursion_depth;
guint recursion_depth; /* NB: not used anymore, though might be nice to print */
} ScanObjectQueueData;
static void start_fetch (OtPullData *pull_data, FetchObjectData *fetch);
@ -564,9 +564,6 @@ scan_dirtree_object (OtPullData *pull_data,
GCancellable *cancellable,
GError **error)
{
if (recursion_depth > OSTREE_MAX_RECURSION)
return glnx_throw (error, "Exceeded maximum recursion");
g_autoptr(GVariant) tree = NULL;
if (!ostree_repo_load_variant (pull_data->repo, OSTREE_OBJECT_TYPE_DIR_TREE, checksum,
&tree, error))
@ -1188,13 +1185,6 @@ scan_commit_object (OtPullData *pull_data,
gint depth;
gboolean is_partial;
if (recursion_depth > OSTREE_MAX_RECURSION)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Exceeded maximum recursion");
goto out;
}
if (g_hash_table_lookup_extended (pull_data->commit_to_depth, checksum,
NULL, &depthp))
{