Unverified Commit c9c6dfb9 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8346 [sync] PR-8248: gfs2: ignore negated quota changes

parents b618d398 2d401b7d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -431,6 +431,17 @@ static int qd_check_sync(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd,
	    (sync_gen && (qd->qd_sync_gen >= *sync_gen)))
		return 0;

	/*
	 * If qd_change is 0 it means a pending quota change was negated.
	 * We should not sync it, but we still have a qd reference and slot
	 * reference taken by gfs2_quota_change -> do_qc that need to be put.
	 */
	if (!qd->qd_change && test_and_clear_bit(QDF_CHANGE, &qd->qd_flags)) {
		slot_put(qd);
		qd_put(qd);
		return 0;
	}

	if (!lockref_get_not_dead(&qd->qd_lockref))
		return 0;