]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gfs2: Be more careful with the quota sync generation
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 7 Jun 2024 13:54:21 +0000 (15:54 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 20 Jun 2024 14:38:15 +0000 (16:38 +0200)
commitd9a75a60699dedaac17d2b5170bb2e3cdc03481e
treea554fea688629faec66b724cde4f40ee73019ecc
parent8d89e068deccb4f34d412df4042f37a75e126259
gfs2: Be more careful with the quota sync generation

The quota sync generation is only ever updated under sd_quota_sync_mutex
by gfs2_quota_sync(), but its current value is fetched ouside of that
mutex, so use WRITE_ONCE() and READ_ONCE() when accessing it without
holding that mutex.

Pass the current sync generation to do_sync() from its callers to ensure
that we're not recording the wrong generation when the syncing is
done.  Also, make sure that qd->qd_sync_gen only ever moves forward.

In gfs2_quota_sync(), only write the new sync generation when we know
that there are changes.  This eliminates the need for function
sd_changed(), which we will remove in the next commit.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/quota.c