Skip to content

Commit a536bf9

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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>
1 parent e85e74e commit a536bf9

5 files changed

Lines changed: 4 additions & 1 deletion

File tree

fs/xfs/scrub/dqiterate.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ xchk_dquot_iter(
205205
if (error)
206206
return error;
207207

208-
mutex_lock(&dq->q_qlock);
209208
cursor->id = dq->q_id + 1;
210209
*dqpp = dq;
211210
return 1;

fs/xfs/scrub/quota.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ xchk_quota(
329329
/* Now look for things that the quota verifiers won't complain about. */
330330
xchk_dqiter_init(&cursor, sc, dqtype);
331331
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
332+
mutex_lock(&dq->q_qlock);
332333
error = xchk_quota_item(&sqi, dq);
333334
mutex_unlock(&dq->q_qlock);
334335
xfs_qm_dqrele(dq);

fs/xfs/scrub/quota_repair.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ xrep_quota_problems(
512512

513513
xchk_dqiter_init(&cursor, sc, dqtype);
514514
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
515+
mutex_lock(&dq->q_qlock);
515516
error = xrep_quota_item(&rqi, dq);
516517
mutex_unlock(&dq->q_qlock);
517518
xfs_qm_dqrele(dq);

fs/xfs/scrub/quotacheck.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ xqcheck_compare_dqtype(
675675
/* Compare what we observed against the actual dquots. */
676676
xchk_dqiter_init(&cursor, sc, dqtype);
677677
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
678+
mutex_lock(&dq->q_qlock);
678679
error = xqcheck_compare_dquot(xqc, dqtype, dq);
679680
mutex_unlock(&dq->q_qlock);
680681
xfs_qm_dqrele(dq);

fs/xfs/scrub/quotacheck_repair.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ xqcheck_commit_dqtype(
155155
*/
156156
xchk_dqiter_init(&cursor, sc, dqtype);
157157
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
158+
mutex_lock(&dq->q_qlock);
158159
error = xqcheck_commit_dquot(xqc, dqtype, dq);
159160
mutex_unlock(&dq->q_qlock);
160161
xfs_qm_dqrele(dq);

0 commit comments

Comments
 (0)