]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
gfs2: Fix fallocate chunk size
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 20 Feb 2018 15:03:24 +0000 (08:03 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commitac61a48a42099e648a7ca98f693f128c2bdcfa7c
tree450ed882b8c56c5df844f5d2d9f93a069eb8aef3
parent7e16d091a47ee30090f3b3d58b6235adeb037fbc
gfs2: Fix fallocate chunk size

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 174d1232ebc84fcde8f5889d1171c9c7e74a10a7 ]

The chunk size of allocations in __gfs2_fallocate is calculated
incorrectly.  The size can collapse, causing __gfs2_fallocate to
allocate one block at a time, which is very inefficient.  This needs
fixing in two places:

In gfs2_quota_lock_check, always set ap->allowed to UINT_MAX to indicate
that there is no quota limit.  This fixes callers that rely on
ap->allowed to be set even when quotas are off.

In __gfs2_fallocate, reset max_blks to UINT_MAX in each iteration of the
loop to make sure that allocation limits from one resource group won't
spill over into another resource group.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/gfs2/file.c
fs/gfs2/quota.h