Konstantin Khlebnikov a94058fec2 fs/quota: handle overflows of sysctl fs.quota.* and report as unsigned long
[ 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>
2020-01-04 19:12:53 +01:00
..
2019-12-13 08:51:18 +01:00
2018-08-18 15:55:59 -07:00
2019-12-17 20:35:45 +01:00
2018-08-23 13:44:43 -07:00
2018-09-28 18:04:06 -07:00
2018-05-26 09:16:44 +02:00
2018-06-15 18:10:01 -03:00
2019-10-05 13:10:03 +02:00
2019-07-03 13:14:48 +02:00
2018-06-15 18:10:01 -03:00
2018-06-19 10:06:29 -07:00
2018-08-22 10:52:48 -07:00
2019-08-09 17:52:28 +02:00
2018-08-25 13:40:38 -07:00
2019-11-24 08:19:14 +01:00
2018-07-12 10:04:29 -04:00
2018-06-11 10:16:13 -07:00
2018-06-11 10:16:13 -07:00
2018-07-27 09:57:23 +10:00
2019-05-31 06:46:18 -07:00
2018-06-28 20:32:51 +09:00
2019-10-17 13:45:42 -07:00
2018-06-04 10:58:12 -07:00
2018-08-08 11:06:20 +02:00
2018-06-22 13:43:27 +09:00
2019-12-13 08:52:43 +01:00
2018-08-18 11:44:53 -07:00
2018-07-12 21:35:28 +02:00
2018-06-05 08:50:16 -04:00
2018-06-07 17:34:35 -07:00
2019-12-31 16:35:38 +01:00
2018-06-07 17:34:39 -07:00
2018-08-23 16:03:58 -07:00
2018-08-22 10:52:45 -07:00
2018-07-10 17:22:35 +02:00
2018-06-07 17:34:36 -07:00
2018-07-19 11:34:23 +01:00
2018-07-25 13:41:22 -07:00
2018-07-21 10:43:12 -05:00
2018-08-22 10:52:46 -07:00
2018-05-31 00:13:56 +08:00
2019-06-11 12:20:52 +02:00
2018-07-20 01:11:45 +02:00
2018-08-02 17:33:06 -04:00
2018-05-11 17:28:45 -07:00
2018-05-11 17:28:45 -07:00
2018-07-17 09:27:43 +02:00
2018-08-02 17:16:05 +02:00
2018-06-29 08:48:06 -06:00
2018-06-07 17:34:35 -07:00
2019-11-10 11:27:54 +01:00
2018-07-07 17:25:23 +02:00
2018-08-16 12:14:42 -07:00
2019-04-17 08:38:45 +02:00
2018-06-20 11:35:56 +02:00
2018-08-14 16:39:13 -07:00
2018-08-18 11:44:53 -07:00
2018-11-13 11:08:51 -08:00
2019-06-17 19:51:56 +02:00
2018-05-14 09:51:34 -04:00