Skip to content

Commit 9d4a49d

Browse files
Andreas Gruenbachermehmetb0
authored andcommitted
gfs2: Revert "ignore negated quota changes"
BugLink: https://bugs.launchpad.net/bugs/2097393 [ Upstream commit 4b4b637 ] Commit 4c6a081 ("gfs2: ignore negated quota changes") skips quota changes with qd_change == 0 instead of writing them back, which leaves behind non-zero qd_change values in the affected slots. The kernel then assumes that those slots are unused, while the qd_change values on disk indicate that they are indeed still in use. The next time the filesystem is mounted, those invalid slots are read in from disk, which will cause inconsistencies. Revert that commit to avoid filesystem corruption. This reverts commit 4c6a081. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
1 parent 318d13b commit 9d4a49d

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

fs/gfs2/quota.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -467,17 +467,6 @@ static bool qd_grab_sync(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd,
467467
qd->qd_sync_gen >= sync_gen)
468468
return false;
469469

470-
/*
471-
* If qd_change is 0 it means a pending quota change was negated.
472-
* We should not sync it, but we still have a qd reference and slot
473-
* reference taken by gfs2_quota_change -> do_qc that need to be put.
474-
*/
475-
if (!qd->qd_change && test_and_clear_bit(QDF_CHANGE, &qd->qd_flags)) {
476-
slot_put(qd);
477-
qd_put(qd);
478-
return false;
479-
}
480-
481470
if (!lockref_get_not_dead(&qd->qd_lockref))
482471
return false;
483472

0 commit comments

Comments
 (0)