From: David Disseldorp <ddiss@suse.de>
To: David Sterba <dsterba@suse.cz>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: drop unused memparse() parameter
Date: Thu, 7 Dec 2023 10:52:55 +1100 [thread overview]
Message-ID: <20231207105255.5cbd892a@echidna> (raw)
In-Reply-To: <20231206185330.GS2751@twin.jikos.cz>
On Wed, 6 Dec 2023 19:53:31 +0100, David Sterba wrote:
> On Wed, Dec 06, 2023 at 11:21:43AM +1100, David Disseldorp wrote:
> > On Tue, 5 Dec 2023 15:22:53 +0100, David Sterba wrote:
> >
> > > On Tue, Dec 05, 2023 at 10:13:29PM +1100, David Disseldorp wrote:
> > > > The @retptr parameter for memparse() is optional.
> > > > btrfs_devinfo_scrub_speed_max_store() doesn't use it for any input
> > > > validation, so the parameter can be dropped.
> > >
> > > Or should it be used for validation? memparse is also used in
> > > btrfs_chunk_size_store() that accepts whitespace as trailing characters
> > > (namely '\n' if the value is from echo).
> >
> > It probably should have been used for validation when originally added,
> > but the current behaviour is now part of the sysfs scrub_speed_max API.
> > Failing on invalid input would break scripts which do things like
> > echo clear > /sys/fs/btrfs/UUID/devinfo/1/scrub_speed_max
>
> I'm not sure the 'part of the API' is a valid agrument here. It's
> documented that the value is in bytes and that suffixes can be passed
> for convenience. How come anybody would use 'clear' in the first place
> and expect it to work with undefined meaning?
Most people don't read documentation :). If there's a willingness to
accept any fallout from adding the validation then I'm happy to do that.
Will send a v2.
Cheers, David
next prev parent reply other threads:[~2023-12-06 23:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 11:13 [PATCH] btrfs: drop unused memparse() parameter David Disseldorp
2023-12-05 12:48 ` Johannes Thumshirn
2023-12-05 14:22 ` David Sterba
2023-12-06 0:21 ` David Disseldorp
2023-12-06 18:53 ` David Sterba
2023-12-06 23:52 ` David Disseldorp [this message]
2023-12-07 13:55 ` David Sterba
2023-12-08 0:41 ` [PATCH] btrfs: validate scrub_speed_max sysfs string David Disseldorp
2023-12-11 3:18 ` Qu Wenruo
2023-12-11 3:56 ` David Disseldorp
2023-12-13 22:50 ` David Sterba
2023-12-13 22:52 ` David Sterba
2023-12-07 2:31 ` [PATCH] btrfs: drop unused memparse() parameter Qu Wenruo
2023-12-07 12:15 ` David Sterba
2023-12-07 19:56 ` Qu Wenruo
2023-12-13 23:15 ` David Sterba
2023-12-13 23:46 ` Qu Wenruo
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=20231207105255.5cbd892a@echidna \
--to=ddiss@suse.de \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@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