xfs: upgrade the extent counters in xfs_reflink_end_cow_extent later
authorChristoph Hellwig <hch@lst.de>
Thu, 2 May 2024 07:33:53 +0000 (09:33 +0200)
committerChandan Babu R <chandanbabu@kernel.org>
Fri, 3 May 2024 05:50:06 +0000 (11:20 +0530)
commit99fb6b7ad1f2fb83d8df2c1382be63a1f50b1ae0
treefbffa2afdbb17701a26e871673bb03a6e12b8858
parentcc3c92e7e79eb5f7f3ec4d5790ade384b7d294f7
xfs: upgrade the extent counters in xfs_reflink_end_cow_extent later

Defer the extent counter size upgrade until we know we're going to
modify the extent mapping.  This also defers dirtying the transaction
and will allow us safely back out later in the function in later
changes.

Fixes: 4f86bb4b66c9 ("xfs: Conditionally upgrade existing inodes to use large extent counters")
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_reflink.c