def METHOD_NAME(user_info_volumes, already_done, tree, vol):
    # check if mother volume exists
    uiv = user_info_volumes
    if vol.mother not in uiv:
        gate.fatal(
            f"Cannot find a mother volume named '{vol.mother}', for the volume {vol}"
        )
    already_done[vol.name] = "in_progress"
    m = uiv[vol.mother]
    # check for cycle
    if m.mother is not None:
        if m.name not in already_done:
            METHOD_NAME(uiv, already_done, tree, m)
        else:
            if already_done[m.name] == "in_progress":
                s = f"Error while building the tree, is there a cycle ? "
                s += f"\n volume is {vol}"
                s += f"\n parent is {m}"
                gate.fatal(s)
    # check not already exist
    if vol.name in tree:
        s = f"Node already exist in tree {vol.name} -> {tree}"
        s = s + f"\n Probably two volumes with the same name ?"
        gate.fatal(s)
    # create the node
    tree[vol.name] = Node(vol.name, parent=tree[m.name])
    already_done[vol.name] = True