From: Darrick J. Wong Date: Sat, 14 Nov 2020 17:08:47 +0000 (-0500) Subject: xfs: fix flags argument to rmap lookup when converting shared file rmaps X-Git-Tag: v5.10.0-rc0~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d1b7499ce491c3e85dec6e70d01ca36d64e13fa;p=thirdparty%2Fxfsprogs-dev.git xfs: fix flags argument to rmap lookup when converting shared file rmaps Source kernel commit: ea8439899c0b15a176664df62aff928010fad276 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 Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c index f02f38ac4..6205b8ed4 100644 --- a/libxfs/xfs_rmap.c +++ b/libxfs/xfs_rmap.c @@ -1513,7 +1513,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;