]> www.infradead.org Git - users/dwmw2/linux.git/commit
gfs2: Add some missing quota locking
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 5 Jun 2024 23:15:36 +0000 (01:15 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 12 Jun 2024 18:33:51 +0000 (20:33 +0200)
commitd5563f42f59ed2cddf1021a34c9cdd8f4a89021c
tree47a702dcf929360f0c13a4cd04471212edd1c776
parent614abc11870ee7ec5a32c81b7ecf4232ede48ecb
gfs2: Add some missing quota locking

The quota code is missing some locking between local quota changes and
syncing those quota changes to the global quota file (gfs2_quota_sync);
in particular, qd->qd_change needs to be kept in sync with the
QDF_CHANGE change flag and the number of references held.  Use the
qd->qd_lockref.lock spinlock for that.

With the qd->qd_lockref.lock spinlock held, we can no longer call
lockref_get(), so turn qd_hold() into a variant that assumes that the
lock is held.  This function is really supposed to take an additional
reference when one or more references are already held, so check for
that instead of checking if the lockref is dead.

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