High-quality carbonate gas reservoirs of the Upper Permian Changxing Formation (P2ch) in the eastern Sichuan Basin are mainly dolostones. Subsurface core samples from the Longhui-Tieshan area were studied to determine the origins of dolomitizing fluids and interpret porosity evolution during dolomitization. Petrographically, two dolomite types were identified, including micritic to fine-sized dolomites (type 1) and fine-to coarse-sized sucrosic dolomites (type 2). The type 1 dolomites, characterized by micritic crystals (<10 μm) and low Mg/Ca order degrees (mean value of 0.557), selectively replace micritic matrices in carbonates and preferentially occur at intervals rich in micrite, indicating their open, near-surface origin. The type 2 dolomites, including four subtypes, i.e., types 2a, 2b, 2c, and 2d, are characterized by coarse crystals (50 μm ∼ >500 μm) and high Mg/Ca order degrees (mean value of 0.787). Low Fe and Mn concentrations (163 ppm and 69 ppm, respectively), high homogenization temperatures (60 °C–200 °C), depleted δ18O values (mean value of −5.14‰), and Sr isotope compositions (mean value of 0.707643), collectively suggest that the dolomitizing fluid of type 2 dolomites was likely derived from buried, imprisoned brine water closely associated with Early Triassic seawater but unrelated to meteoric water. During the first stage of porosity evolution (i.e., stage A), carbonate porosity was slightly decreased by dolomitizing fluids preferentially replacing micritic components and CO32− ions involvement. During the second stage (i.e., stage B), carbonate porosity was slightly increased because molecular replacement occurred under an environment with insufficient CO32− ions. During the advanced stage (i.e., stage C), dolomitization was intensively weakened because of CO32− ions depletion, yet the acidic dissolution and structural movements produced considerable pores and fractures, forming high-quality reservoirs. Type 1 dolomites are volumetrically minor and have no reservoir potential, effective reservoirs are closely associated with type 2 dolomites. A burial dolomitization model of type 2 dolomites is proposed based on the previous analyses. Dolomitizing fluids moved downward through open faults and unconformities into P2ch carbonates. Potentially high-quality reservoirs likely occur at locations close to dolomitizing fluid conduits.