diff options
| author | Christoph Hellwig <hch@lst.de> | 2025-11-10 14:23:05 +0100 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2025-11-11 11:45:58 +0100 |
| commit | bfca8760f47ecda61441950babbea6f79a51b377 (patch) | |
| tree | 10c3ee62f1714545246201c82bce9663d34f8a6d | |
| parent | a536bf9bec6ac461ec48bc8627545d56e4e71e9c (diff) | |
xfs: move q_qlock locking into xchk_quota_item
This avoids a pointless roundtrip because ilock needs to be taken first.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
| -rw-r--r-- | fs/xfs/scrub/quota.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c index b711d36c5ec9..5c5374c44c5a 100644 --- a/fs/xfs/scrub/quota.c +++ b/fs/xfs/scrub/quota.c @@ -155,10 +155,7 @@ xchk_quota_item( * We want to validate the bmap record for the storage backing this * dquot, so we need to lock the dquot and the quota file. For quota * operations, the locking order is first the ILOCK and then the dquot. - * However, dqiterate gave us a locked dquot, so drop the dquot lock to - * get the ILOCK. */ - mutex_unlock(&dq->q_qlock); xchk_ilock(sc, XFS_ILOCK_SHARED); mutex_lock(&dq->q_qlock); @@ -251,6 +248,7 @@ xchk_quota_item( xchk_quota_item_timer(sc, offset, &dq->q_rtb); out: + mutex_unlock(&dq->q_qlock); if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) return -ECANCELED; @@ -329,9 +327,7 @@ xchk_quota( /* Now look for things that the quota verifiers won't complain about. */ xchk_dqiter_init(&cursor, sc, dqtype); while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) { - mutex_lock(&dq->q_qlock); error = xchk_quota_item(&sqi, dq); - mutex_unlock(&dq->q_qlock); xfs_qm_dqrele(dq); if (error) break; |
