All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <tom.leiming@gmail.com>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] blk-mq: avoid sysfs buffer overflow by too many CPU cores
Date: Sun, 3 Nov 2019 18:56:19 -0700	[thread overview]
Message-ID: <a7100fe3-fe27-407a-8237-27dc31df59d0@kernel.dk> (raw)
In-Reply-To: <CACVXFVO3MafpBcufM+eYZM5A-Yip5JGSqiC4kOgejVNnTNjYOA@mail.gmail.com>

On 11/3/19 4:57 PM, Ming Lei wrote:
> On Sun, Nov 3, 2019 at 8:28 AM Chaitanya Kulkarni
> <Chaitanya.Kulkarni@wdc.com> wrote:
>>
>> Ming,
>>
>> On 11/02/2019 01:02 AM, Ming Lei wrote:
>>> It is reported that sysfs buffer overflow can be triggered in case
>>> of too many CPU cores(>841 on 4K PAGE_SIZE) when showing CPUs of
>>> hctx via/sys/block/$DEV/mq/$N/cpu_list.
>>>
>>> So use snprintf for avoiding the potential buffer overflow.
>>>
>>> This version doesn't change the attribute format, and simply stop
>>> to show CPU number if the buffer is to be overflow.
>>
>> Does it make sense to also add a print or WARN_ON in case of overflow ?
> 
> Yes, it does, could you cook a patch for that?

No it doesn't. The WARN_ON brings absolutely nothing. If you're using
a script, it gets the same values out and doesn't see the warning. If
it's a human cat'ing it, they will probably already realize that
we're missing CPUs. Or maybe not even see the warning. It's useless.

We should either make this seqfile, or just kill the file. Those are
the only two options that make any sense.

-- 
Jens Axboe


  reply	other threads:[~2019-11-04  1:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-02  8:02 [PATCH] blk-mq: avoid sysfs buffer overflow by too many CPU cores Ming Lei
2019-11-02 14:03 ` Jens Axboe
2019-11-03  0:25 ` Chaitanya Kulkarni
2019-11-03 15:02   ` Jens Axboe
2019-11-03 20:26     ` Chaitanya Kulkarni
2019-11-03 23:57   ` Ming Lei
2019-11-04  1:56     ` Jens Axboe [this message]
2019-11-04  6:57       ` Hannes Reinecke
2019-11-04 14:13         ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2019-08-15 12:15 Ming Lei
2019-08-15 12:24 ` Greg KH
2019-08-15 12:29   ` Ming Lei
2019-08-15 12:35     ` Greg KH
2019-08-15 12:43       ` Ming Lei
2019-08-15 13:21         ` Greg KH
2019-08-15 23:10         ` Ray, Mark C (Global Solutions Engineering (GSE))
2019-08-16  2:49           ` Ming Lei
2019-08-16  7:12             ` Greg KH
2019-08-16 14:21               ` Jens Axboe

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=a7100fe3-fe27-407a-8237-27dc31df59d0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=tom.leiming@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.