On 11/3/19 11:57 PM, Hannes Reinecke wrote: > On 11/4/19 2:56 AM, Jens Axboe wrote: >> On 11/3/19 4:57 PM, Ming Lei wrote: >>> On Sun, Nov 3, 2019 at 8:28 AM Chaitanya Kulkarni >>> <Chaitanya.Kulkarni@xxxxxxx> 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. >> > I'd rather retain that file; it proved really useful when debugging > interrupt affinity issues. Care to take a look at converting to seq_file? -- Jens Axboe