]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gfs2: move privileged user check to gfs2_quota_lock_check
authorBob Peterson <rpeterso@redhat.com>
Tue, 5 May 2020 16:53:21 +0000 (11:53 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:23:02 +0000 (08:23 +0200)
commit199dfd7f1e74c4f9609cd657a0c5db37073e3696
treeeecba09f9ea4990bc3138cd6220132e9613e8347
parenta592ca2172b8a0ed8be55d30a6ccb1028ab947fe
gfs2: move privileged user check to gfs2_quota_lock_check

[ Upstream commit 4ed0c30811cb4d30ef89850b787a53a84d5d2bcb ]

Before this patch, function gfs2_quota_lock checked if it was called
from a privileged user, and if so, it bypassed the quota check:
superuser can operate outside the quotas.
That's the wrong place for the check because the lock/unlock functions
are separate from the lock_check function, and you can do lock and
unlock without actually checking the quotas.

This patch moves the check to gfs2_quota_lock_check.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/quota.c
fs/gfs2/quota.h