]> git.ipfire.org Git - thirdparty/linux.git/commit - fs/gfs2/quota.c
gfs2: perform quota checks against allocation parameters
authorAbhi Das <adas@redhat.com>
Wed, 18 Mar 2015 17:03:41 +0000 (12:03 -0500)
committerBob Peterson <rpeterso@redhat.com>
Wed, 18 Mar 2015 17:46:54 +0000 (12:46 -0500)
commitb8fbf471edb3dbf441716fd2a52a7ca76c381381
treea5a2132cc29397dd1f1d8892497dbf18b2fb125f
parentf1ea6f4ec0a48d7b6bbf4d380a0ac14d69fadb44
gfs2: perform quota checks against allocation parameters

Use struct gfs2_alloc_parms as an argument to gfs2_quota_check()
and gfs2_quota_lock_check() to check for quota violations while
accounting for the new blocks requested by the current operation
in ap->target.

Previously, the number of new blocks requested during an operation
were not accounted for during quota_check and would allow these
operations to exceed quota. This was not very apparent since most
operations allocated only 1 block at a time and quotas would get
violated in the next operation. i.e. quota excess would only be by
1 block or so. With fallocate, (where we allocate a bunch of blocks
at once) the quota excess is non-trivial and is addressed by this
patch.

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/aops.c
fs/gfs2/bmap.c
fs/gfs2/file.c
fs/gfs2/incore.h
fs/gfs2/inode.c
fs/gfs2/quota.c
fs/gfs2/quota.h
fs/gfs2/xattr.c