]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: push q_qlock acquisition from xchk_dquot_iter to the callers.
authorChristoph Hellwig <hch@lst.de>
Mon, 10 Nov 2025 13:23:04 +0000 (14:23 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 11 Nov 2025 10:45:58 +0000 (11:45 +0100)
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>
fs/xfs/scrub/dqiterate.c
fs/xfs/scrub/quota.c
fs/xfs/scrub/quota_repair.c
fs/xfs/scrub/quotacheck.c
fs/xfs/scrub/quotacheck_repair.c

index 6f1185afbf3960c77892861c3e76c3cd2484b412..20c4daedd48df27168b806fed31b9b7a61d68dee 100644 (file)
@@ -205,7 +205,6 @@ xchk_dquot_iter(
        if (error)
                return error;
 
-       mutex_lock(&dq->q_qlock);
        cursor->id = dq->q_id + 1;
        *dqpp = dq;
        return 1;
index cfcd0fb66845df581ce24856a15f96cc32aa6614..b711d36c5ec9bac2db0da015dcf020b8409daf57 100644 (file)
@@ -329,6 +329,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);
index d4ce9e56d3ef688d2a59db1e0efb66f6c7004a62..dae4889bdc8460ca6b253ac98fcb5470a4126be6 100644 (file)
@@ -512,6 +512,7 @@ xrep_quota_problems(
 
        xchk_dqiter_init(&cursor, sc, dqtype);
        while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
+               mutex_lock(&dq->q_qlock);
                error = xrep_quota_item(&rqi, dq);
                mutex_unlock(&dq->q_qlock);
                xfs_qm_dqrele(dq);
index bef63f19cd8772149827d14980c1c3475f7173e7..20220afd90f17300529582f8f6d309eca32b515d 100644 (file)
@@ -675,6 +675,7 @@ xqcheck_compare_dqtype(
        /* Compare what we observed against the actual dquots. */
        xchk_dqiter_init(&cursor, sc, dqtype);
        while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
+               mutex_lock(&dq->q_qlock);
                error = xqcheck_compare_dquot(xqc, dqtype, dq);
                mutex_unlock(&dq->q_qlock);
                xfs_qm_dqrele(dq);
index 3b23219d43eda822b13f0b1f127d36a5112315ed..3013211fa6c107805e85e1b4e327ea5859ec32a8 100644 (file)
@@ -155,6 +155,7 @@ xqcheck_commit_dqtype(
         */
        xchk_dqiter_init(&cursor, sc, dqtype);
        while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
+               mutex_lock(&dq->q_qlock);
                error = xqcheck_commit_dquot(xqc, dqtype, dq);
                mutex_unlock(&dq->q_qlock);
                xfs_qm_dqrele(dq);