linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jan Kara <jack@suse.com>,
	Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Subject: Re: [PATCH] fs/quota: use unsigned int helper for sysctl fs.quota.*
Date: Thu, 7 Nov 2019 12:50:41 +0100	[thread overview]
Message-ID: <20191107115041.GC11400@quack2.suse.cz> (raw)
In-Reply-To: <157312129151.3890.6076128127053624123.stgit@buzz>

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@yandex-team.ru>

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@suse.com>
SUSE Labs, CR

  reply	other threads:[~2019-11-07 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07 10:08 [PATCH] fs/quota: use unsigned int helper for sysctl fs.quota.* Konstantin Khlebnikov
2019-11-07 11:50 ` Jan Kara [this message]
2019-11-07 17:59   ` Konstantin Khlebnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191107115041.GC11400@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=dmtrmonakhov@yandex-team.ru \
    --cc=jack@suse.com \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).