diff mbox series

[42/56] xfs: update rmap to allow cow staging extents in the rt rmap

Message ID 173888087435.2739176.2483204734738730021.stgit@frogsfrogsfrogs (mailing list archive)
State Not Applicable, archived
Headers show
Series [01/56] xfs: tidy up xfs_iroot_realloc | expand

Commit Message

Darrick J. Wong Feb. 6, 2025, 10:46 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Source kernel commit: 0bada82331238bd366aaa0566d125c6338b42590

Don't error out on CoW staging extent records when realtime reflink is
enabled.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 libxfs/xfs_rmap.c |    7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c
index 3748bfc7a9dfc1..8c0c22a3491df4 100644
--- a/libxfs/xfs_rmap.c
+++ b/libxfs/xfs_rmap.c
@@ -284,6 +284,13 @@  xfs_rtrmap_check_meta_irec(
 		if (irec->rm_blockcount != mp->m_sb.sb_rextsize)
 			return __this_address;
 		return NULL;
+	case XFS_RMAP_OWN_COW:
+		if (!xfs_has_rtreflink(mp))
+			return __this_address;
+		if (!xfs_verify_rgbext(rtg, irec->rm_startblock,
+					    irec->rm_blockcount))
+			return __this_address;
+		return NULL;
 	default:
 		return __this_address;
 	}