CO2 released from volcanoes reacts with water in the atmosphere and forms a weak carbonic acid. Plants draw it into the soil and it enters the bedrock causing chemical weathering - carbonation and hydrolysis. Carbonate ions run off into the oceans where it is removed from the water by corals and bivalves. Over time it is deposited on the sea floor as limestone. Limestone on the sea floor is subducted and is erupted as magma.