]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
fs/quota: handle overflows of sysctl fs.quota.* and report as unsigned long
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Sun, 10 Nov 2019 09:49:06 +0000 (12:49 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 05:05:10 +0000 (00:05 -0500)
commit5cb00ed295eb655632a728934962bccb05452acf
tree1bd3a69eb33d06e0d9f2d5b6ac9019ade1bf6974
parent0419ec2f48964886a846f5b6b78d36fd88cb42d9
fs/quota: handle overflows of sysctl fs.quota.* and report as unsigned long

BugLink: https://bugs.launchpad.net/bugs/1860816
[ Upstream commit 6fcbcec9cfc7b3c6a2c1f1a23ebacedff7073e0a ]

Quota statistics counted as 64-bit per-cpu counter. Reading sums per-cpu
fractions as signed 64-bit int, filters negative values and then reports
lower half as signed 32-bit int.

Result may looks like:

fs.quota.allocated_dquots = 22327
fs.quota.cache_hits = -489852115
fs.quota.drops = -487288718
fs.quota.free_dquots = 22083
fs.quota.lookups = -486883485
fs.quota.reads = 22327
fs.quota.syncs = 335064
fs.quota.writes = 3088689

Values bigger than 2^31-1 reported as negative.

All counters except "allocated_dquots" and "free_dquots" are monotonic,
thus they should be reported as is without filtering negative values.

Kernel doesn't have generic helper for 64-bit sysctl yet,
let's use at least unsigned long.

Link: https://lore.kernel.org/r/157337934693.2078.9842146413181153727.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/quota/dquot.c
include/linux/quota.h