xfs: push q_qlock acquisition from xchk_dquot_iter to the callers.

There is no good reason to take q_qlock in xchk_dquot_iter, which just
provides a reference to the dquot.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Christoph Hellwig 2025-11-10 14:23:04 +01:00 committed by Carlos Maiolino
parent e85e74e4c9
commit a536bf9bec
5 changed files with 4 additions and 1 deletions

View File

@ -205,7 +205,6 @@ xchk_dquot_iter(
if (error) if (error)
return error; return error;
mutex_lock(&dq->q_qlock);
cursor->id = dq->q_id + 1; cursor->id = dq->q_id + 1;
*dqpp = dq; *dqpp = dq;
return 1; return 1;

View File

@ -329,6 +329,7 @@ xchk_quota(
/* Now look for things that the quota verifiers won't complain about. */ /* Now look for things that the quota verifiers won't complain about. */
xchk_dqiter_init(&cursor, sc, dqtype); xchk_dqiter_init(&cursor, sc, dqtype);
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) { while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
mutex_lock(&dq->q_qlock);
error = xchk_quota_item(&sqi, dq); error = xchk_quota_item(&sqi, dq);
mutex_unlock(&dq->q_qlock); mutex_unlock(&dq->q_qlock);
xfs_qm_dqrele(dq); xfs_qm_dqrele(dq);

View File

@ -512,6 +512,7 @@ xrep_quota_problems(
xchk_dqiter_init(&cursor, sc, dqtype); xchk_dqiter_init(&cursor, sc, dqtype);
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) { while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
mutex_lock(&dq->q_qlock);
error = xrep_quota_item(&rqi, dq); error = xrep_quota_item(&rqi, dq);
mutex_unlock(&dq->q_qlock); mutex_unlock(&dq->q_qlock);
xfs_qm_dqrele(dq); xfs_qm_dqrele(dq);

View File

@ -675,6 +675,7 @@ xqcheck_compare_dqtype(
/* Compare what we observed against the actual dquots. */ /* Compare what we observed against the actual dquots. */
xchk_dqiter_init(&cursor, sc, dqtype); xchk_dqiter_init(&cursor, sc, dqtype);
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) { while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
mutex_lock(&dq->q_qlock);
error = xqcheck_compare_dquot(xqc, dqtype, dq); error = xqcheck_compare_dquot(xqc, dqtype, dq);
mutex_unlock(&dq->q_qlock); mutex_unlock(&dq->q_qlock);
xfs_qm_dqrele(dq); xfs_qm_dqrele(dq);

View File

@ -155,6 +155,7 @@ xqcheck_commit_dqtype(
*/ */
xchk_dqiter_init(&cursor, sc, dqtype); xchk_dqiter_init(&cursor, sc, dqtype);
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) { while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
mutex_lock(&dq->q_qlock);
error = xqcheck_commit_dquot(xqc, dqtype, dq); error = xqcheck_commit_dquot(xqc, dqtype, dq);
mutex_unlock(&dq->q_qlock); mutex_unlock(&dq->q_qlock);
xfs_qm_dqrele(dq); xfs_qm_dqrele(dq);