[Cluster-devel] [GFS2] gfs2: fix quota refresh race in do_glock()

Bob Peterson rpeterso at redhat.com
Wed Apr 8 14:38:47 UTC 2015


----- 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 <adas at redhat.com>
> ---

Hi,

ACK

I pushed this patch to the for-next branch of the linux-gfs2 tree.

Regards,

Bob Peterson
Red Hat File Systems




More information about the Cluster-devel mailing list