[PATCH 3/3] xfs: work around sparse context tracking in xfs_qm_dquot_isolate

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-sparse,org.kernel.vger.linux-kernel,org.kernel.vger.linux-xfs
Message-ID <[email protected]>
sparse gets confused by the goto after spin_trylock:

fs/xfs/xfs_qm.c:486:33: warning: context imbalance in 'xfs_qm_dquot_isolate' - different lock contexts for basic block

work around this by duplicating the trivial amount of code after the
label.

Signed-off-by: Christoph Hellwig <[email protected]>
---
 fs/xfs/xfs_qm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 95be67ac6eb4..66d25ac9600b 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -422,8 +422,11 @@ xfs_qm_dquot_isolate(
 	struct xfs_qm_isolate	*isol = arg;
 	enum lru_status		ret = LRU_SKIP;
 
-	if (!spin_trylock(&dqp->q_lockref.lock))
-		goto out_miss_busy;
+	if (!spin_trylock(&dqp->q_lockref.lock)) {
+		trace_xfs_dqreclaim_busy(dqp);
+		XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses);
+		return LRU_SKIP;
+	}
 
 	/*
 	 * If something else is freeing this dquot and hasn't yet removed it
@@ -482,7 +485,6 @@ xfs_qm_dquot_isolate(
 
 out_miss_unlock:
 	spin_unlock(&dqp->q_lockref.lock);
-out_miss_busy:
 	trace_xfs_dqreclaim_busy(dqp);
 	XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses);
 	return ret;
-- 
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.