diff mbox series

[1/3] xfs: fix flags argument to rmap lookup when converting shared file rmaps

Message ID 160494583579.772693.11055963967780181272.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs: fix serious bugs in rmap key comparison | expand

Commit Message

Darrick J. Wong Nov. 9, 2020, 6:17 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Pass the same oldext argument (which contains the existing rmapping's
unwritten state) to xfs_rmap_lookup_le_range at the start of
xfs_rmap_convert_shared.  At this point in the code, flags is zero,
which means that we perform lookups using the wrong key.

Fixes: 3f165b334e51 ("xfs: convert unwritten status of reverse mappings for shared files")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_rmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig Nov. 10, 2020, 6:33 p.m. UTC | #1
On Mon, Nov 09, 2020 at 10:17:15AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Pass the same oldext argument (which contains the existing rmapping's
> unwritten state) to xfs_rmap_lookup_le_range at the start of
> xfs_rmap_convert_shared.  At this point in the code, flags is zero,
> which means that we perform lookups using the wrong key.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
index 340c83f76c80..2668ebe02865 100644
--- a/fs/xfs/libxfs/xfs_rmap.c
+++ b/fs/xfs/libxfs/xfs_rmap.c
@@ -1514,7 +1514,7 @@  xfs_rmap_convert_shared(
 	 * record for our insertion point. This will also give us the record for
 	 * start block contiguity tests.
 	 */
-	error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, flags,
+	error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, oldext,
 			&PREV, &i);
 	if (error)
 		goto done;