This is a revised set of patches for bz1174295 to address fallocate/quota issues. These patches are only compile tested so far.
patch 1 - This is the patch that actually addresses the quota exceed issue. Quota checks were not being performed against the blocks about to be allocated. patch 2 - Modify gfs2_inplace_reserve() and gfs2_quota_check() to return available number of blocks in case of failure. patch 3 - Allows fallocate to take advantage of patch 2 to efficiently max out quotas or fill up the fs instead of returning -EDQUOT/-ENOSPC and leaving some available blocks unallocated. Abhi Das (3): gfs2: perform quota checks against allocation parameters gfs2: allow quota_check and inplace_reserve to return available blocks gfs2: allow fallocate to max out quotas/fs efficiently fs/gfs2/aops.c | 6 +++--- fs/gfs2/bmap.c | 2 +- fs/gfs2/file.c | 27 ++++++++++++++++----------- fs/gfs2/incore.h | 3 ++- fs/gfs2/inode.c | 18 ++++++++++-------- fs/gfs2/quota.c | 21 ++++++++++++++++++--- fs/gfs2/quota.h | 8 +++++--- fs/gfs2/rgrp.c | 8 +++++++- fs/gfs2/rgrp.h | 2 +- fs/gfs2/xattr.c | 2 +- 10 files changed, 64 insertions(+), 33 deletions(-) -- 1.8.1.4