From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 8 Apr 2015 10:38:47 -0400 (EDT) Subject: [Cluster-devel] [GFS2] gfs2: fix quota refresh race in do_glock() In-Reply-To: <1428428893-53810-1-git-send-email-adas@redhat.com> References: <1428428893-53810-1-git-send-email-adas@redhat.com> Message-ID: <2112922455.11924800.1428503927117.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- > quotad periodically syncs in-memory quotas to the ondisk quota file > and sets the QDF_REFRESH flag so that a subsequent read of a synced > quota is re-read from disk. > > gfs2_quota_lock() checks for this flag and sets a 'force' bit to > force re-read from disk if requested. However, there is a race > condition here. It is possible for gfs2_quota_lock() to find the > QDF_REFRESH flag unset (i.e force=0) and quotad comes in immediately > after and syncs the relevant quota and sets the QDF_REFRESH flag. > gfs2_quota_lock() resumes with force=0 and uses the stale in-memory > quota usage values that result in miscalculations. > > This patch fixes this race by moving the check for the QDF_REFRESH > flag check further out into the gfs2_quota_lock() process, i.e, in > do_glock(), under the protection of the quota glock. > > Resolves: rhbz#1174295 > Signed-off-by: Abhi Das > --- Hi, ACK I pushed this patch to the for-next branch of the linux-gfs2 tree. Regards, Bob Peterson Red Hat File Systems