[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251114055249.1517520-4-hch@lst.de>
Date: Fri, 14 Nov 2025 06:52:25 +0100
From: Christoph Hellwig <hch@....de>
To: Carlos Maiolino <cem@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: "Luc Van Oostenryck" <luc.vanoostenryck@...il.com>,
Chris Li <sparse@...isli.org>,
linux-sparse@...r.kernel.org,
linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] xfs: work around sparse context tracking in xfs_qm_dquot_isolate
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 <hch@....de>
---
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
Powered by blists - more mailing lists