nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	linux-raid@vger.kernel.org, nvdimm@lists.linux.dev,
	antlists@youngman.org.uk, Dan Williams <dan.j.williams@intel.com>,
	Hannes Reinecke <hare@suse.de>, Jens Axboe <axboe@kernel.dk>,
	NeilBrown <neilb@suse.de>, Richard Fan <richard.fan@suse.com>,
	Vishal L Verma <vishal.l.verma@intel.com>,
	rafael@kernel.org
Subject: Re: Too large badblocks sysfs file (was: [PATCH v3 0/7] badblocks improvement for multiple bad block ranges)
Date: Thu, 23 Sep 2021 15:13:52 +0800	[thread overview]
Message-ID: <0a9f7fd9-a587-0152-118f-c61fe563f97f@suse.de> (raw)
In-Reply-To: <YUwjAJXjFR9tbJiQ@kroah.com>

On 9/23/21 2:47 PM, Greg Kroah-Hartman wrote:
> On Thu, Sep 23, 2021 at 02:14:12PM +0800, Coly Li wrote:
>> On 9/23/21 2:08 PM, Greg Kroah-Hartman wrote:
>>> On Thu, Sep 23, 2021 at 01:59:28PM +0800, Coly Li wrote:
>>>> Hi all the kernel gurus, and folks in mailing lists,
>>>>
>>>> This is a question about exporting 4KB+ text information via sysfs
>>>> interface. I need advice on how to handle the problem.
>> Hi Greg,
>>
>> This is the code in mainline kernel for quite long time.
> {sigh}
>
> What tools rely on this?  If none, just don't add new stuff to the file
> and work to create a new api instead.

At least I know mdadm uses this sysfs interface for md raid component 
disks monitoring. It has been in mdadm for around 5 years.

Yes you are right, let it be for existing sysfs interface to avoid 
breaking things.

>>> Please do not do that.  Seriously, that is not what sysfs is for, and is
>>> an abuse of it.
>>>
>>> sysfs is for "one value per file" and should never even get close to a
>>> 4kb limit.  If it does, you are doing something really really wrong and
>>> should just remove that sysfs file from the system and redesign your
>>> api.
>> I understand this. And what I addressed is the problem I need to fix.
>>
>> The code is there for almost 10 years, I just find it during my work on bad
>> blocks API fixing.
>>
>>
>>>> Recently I work on the bad blocks API (block/badblocks.c) improvement, there
>>>> is a sysfs file to export the bad block ranges for me raid. E.g for a md
>>>> raid1 device, file
>>>>       /sys/block/md0/md/rd0/bad_blocks
>>>> may contain the following text content,
>>>>       64 32
>>>>      128 8
>>> Ick, again, that's not ok at all.  sysfs files should never have to be
>>> parsed like this.
>> I cannot agree more with you. What I am asking for was ---- how to fix it ?
> Best solution, come up with a new api.
>
> Worst solution, you are stuck with the existing file and I can show you
> the "way out" of dealing with files larger than 4kb in sysfs that a
> number of other apis are being forced to do as they grow over time.

Now I am sure you are very probably not willing to accept the patches, 
even I know how to do that :-)

>
> But ideally, just drop ths api and make a new one please.

OK, then I leave the existing things as what they are, avoid to make 
them worse.

Thanks for your response.

Coly Li


  reply	other threads:[~2021-09-23  7:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 16:36 [PATCH v3 0/7] badblocks improvement for multiple bad block ranges Coly Li
2021-09-13 16:36 ` [PATCH v3 1/6] badblocks: add more helper structure and routines in badblocks.h Coly Li
2021-09-27  7:23   ` Geliang Tang
2021-09-27  8:23     ` Coly Li
2021-09-13 16:36 ` [PATCH v3 2/6] badblocks: add helper routines for badblock ranges handling Coly Li
2021-09-27  7:25   ` Geliang Tang
2021-09-27  8:17     ` Coly Li
2021-09-13 16:36 ` [PATCH v3 3/6] badblocks: improvement badblocks_set() for multiple " Coly Li
2021-09-27  7:30   ` Geliang Tang
2021-09-27  8:16     ` Coly Li
2021-09-13 16:36 ` [PATCH v3 4/6] badblocks: improve badblocks_clear() " Coly Li
2021-09-13 16:36 ` [PATCH v3 5/6] badblocks: improve badblocks_check() " Coly Li
2021-09-13 16:36 ` [PATCH v3 6/6] badblocks: switch to the improved badblock handling code Coly Li
2021-09-13 16:36 ` [PATCH] test: user space code to test badblocks APIs Coly Li
2021-09-23  5:59 ` Too large badblocks sysfs file (was: [PATCH v3 0/7] badblocks improvement for multiple bad block ranges) Coly Li
2021-09-23  6:08   ` Greg Kroah-Hartman
2021-09-23  6:14     ` Coly Li
2021-09-23  6:47       ` Greg Kroah-Hartman
2021-09-23  7:13         ` Coly Li [this message]
2021-09-23  9:40   ` Hannes Reinecke
2021-09-23  9:57     ` Greg Kroah-Hartman
2021-09-23 10:09   ` NeilBrown
2021-09-23 10:39     ` Greg Kroah-Hartman
2021-09-23 12:55     ` Coly Li

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=0a9f7fd9-a587-0152-118f-c61fe563f97f@suse.de \
    --to=colyli@suse.de \
    --cc=antlists@youngman.org.uk \
    --cc=axboe@kernel.dk \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=nvdimm@lists.linux.dev \
    --cc=rafael@kernel.org \
    --cc=richard.fan@suse.com \
    --cc=vishal.l.verma@intel.com \
    --subject='Re: Too large badblocks sysfs file (was: [PATCH v3 0/7] badblocks improvement for multiple bad block ranges)' \
    /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

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).