Re: [PATCH] fs/quota: use unsigned int helper for sysctl fs.quota.*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu 07-11-19 13:08:11, Konstantin Khlebnikov wrote:
> Report counters as unsigned, otherwise they turn negative at overflow:
> 
> # sysctl fs.quota
> 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
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx>

Fair enough but then 'stats' array in dqstats should be unsigned as well
for consistency and why not actually make everything long when we are at
it? percpu_counter we use is s64 anyway...

								Honza

> ---
>  fs/quota/dquot.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index 6e826b454082..606e1e39674b 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -2865,7 +2865,7 @@ static int do_proc_dqstats(struct ctl_table *table, int write,
>  	/* Update global table */
>  	dqstats.stat[type] =
>  			percpu_counter_sum_positive(&dqstats.counter[type]);
> -	return proc_dointvec(table, write, buffer, lenp, ppos);
> +	return proc_douintvec(table, write, buffer, lenp, ppos);
>  }
>  
>  static struct ctl_table fs_dqstats_table[] = {
> 
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux