linux/fs/gfs2
Abhi Das 3013317795 gfs2: fix quota refresh race in do_glock()
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.

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
2015-04-08 09:31:18 -05:00
..
acl.c GFS2: gfs2_set_acl(): Cache "no acl" as well 2015-03-18 12:41:57 -05:00
acl.h GFS2: Increase the max number of ACLs 2014-03-19 15:16:24 +00:00
aops.c gfs2: perform quota checks against allocation parameters 2015-03-18 12:46:54 -05:00
bmap.c gfs2: perform quota checks against allocation parameters 2015-03-18 12:46:54 -05:00
bmap.h GFS2: Clean up journal extent mapping 2014-03-03 13:50:12 +00:00
dentry.c vfs: Remove unnecessary calls of check_submounts_and_drop 2014-10-09 02:38:56 -04:00
dir.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
dir.h GFS2: Make rename not save dirent location 2014-10-01 14:06:15 +01:00
export.c vfs: make first argument of dir_context.actor typed 2014-10-31 17:48:54 -04:00
file.c gfs2: allow fallocate to max out quotas/fs efficiently 2015-03-18 12:48:02 -05:00
gfs2.h
glock.c gfs2: incorrect check for debugfs returns 2015-03-30 09:13:29 -05:00
glock.h GFS2: Don't use ENOBUFS when ENOMEM is the correct error code 2014-01-16 10:31:13 +00:00
glops.c GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
glops.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
incore.h gfs2: allow quota_check and inplace_reserve to return available blocks 2015-03-18 12:47:10 -05:00
inode.c gfs2: perform quota checks against allocation parameters 2015-03-18 12:46:54 -05:00
inode.h GFS2: Add atomic_open support 2013-06-14 11:17:15 +01:00
Kconfig Finally eradicate CONFIG_HOTPLUG 2013-06-03 14:20:18 -07:00
lock_dlm.c Merge branch 'sched/urgent' into sched/core, to merge fixes before applying new changes 2014-07-28 10:03:00 +02:00
log.c GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
log.h GFS2: remove transaction glock 2014-05-14 10:04:34 +01:00
lops.c GFS2: lops.c: replace 0 by NULL for pointers 2014-04-28 09:41:55 +01:00
lops.h GFS2: Move log buffer lists into transaction 2014-02-24 16:54:54 +00:00
main.c GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
Makefile GFS2: Rename ops_inode.c to inode.c 2011-05-10 13:12:49 +01:00
meta_io.c mm: non-atomically mark page accessed during page cache allocation where possible 2014-06-04 16:54:10 -07:00
meta_io.h GFS2: Fix address space from page function 2014-03-31 17:48:27 +01:00
ops_fstype.c fs: remove mapping->backing_dev_info 2015-01-20 14:03:05 -07:00
quota.c gfs2: fix quota refresh race in do_glock() 2015-04-08 09:31:18 -05:00
quota.h gfs2: perform quota checks against allocation parameters 2015-03-18 12:46:54 -05:00
recovery.c GFS2: fix sprintf format specifier 2015-01-13 10:48:57 +00:00
recovery.h GFS2: Move recovery variables to journal structure in memory 2014-03-07 09:14:48 +00:00
rgrp.c gfs2: allow quota_check and inplace_reserve to return available blocks 2015-03-18 12:47:10 -05:00
rgrp.h gfs2: allow quota_check and inplace_reserve to return available blocks 2015-03-18 12:47:10 -05:00
super.c fs: export inode_to_bdi and use it in favor of mapping->backing_dev_info 2015-01-20 14:03:04 -07:00
super.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
sys.c GFS2: fix sprintf format specifier 2015-01-13 10:48:57 +00:00
sys.h GFS2: dlm based recovery coordination 2012-01-11 09:23:05 +00:00
trace_gfs2.h GFS2: Add origin indicator to glock demote tracing 2013-04-10 10:32:05 +01:00
trans.c GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
trans.h GFS2: Split gfs2_trans_add_bh() into two 2013-01-29 10:28:04 +00:00
util.c GFS2: Convert gfs2_lm_withdraw to use fs_err 2014-03-07 09:39:18 +00:00
util.h GFS2: Convert gfs2_lm_withdraw to use fs_err 2014-03-07 09:39:18 +00:00
xattr.c gfs2: perform quota checks against allocation parameters 2015-03-18 12:46:54 -05:00
xattr.h sanitize xattr handler prototypes 2009-12-16 12:16:49 -05:00