Skip to contentSkip to conversation

xfs: don't return _QUERY_ABORT from xfs_rmap_has_other_keys

PATCH New Darrick J. Wong 1 participant 1 message Aug 26, 2019 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: don't return _QUERY_ABORT from xfs_rmap_has_other_keys

From: Darrick J. Wong <[email protected]>

The xfs_rmap_has_other_keys helper aborts the iteration as soon as it has an answer. Don't let this abort leak out to callers.

---
 fs/xfs/libxfs/xfs_rmap.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/xfs/libxfs/xfs_rmap.c +4 -1
index e6aeb390b2fb..819693ef852c 100644
@@ -2540,8 +2540,11 @@ xfs_rmap_has_other_keys(
 
 	error = xfs_rmap_query_range(cur, &low, &high,
 			xfs_rmap_has_other_keys_helper, &rks);
+	if (error < 0)
+		return error;
+
 	*has_rmap = rks.has_rmap;
-	return error;
+	return 0;
 }
 
 const struct xfs_owner_info XFS_RMAP_OINFO_SKIP_UPDATE = {