public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: David Disseldorp <ddiss@suse.de>, David Sterba <dsterba@suse.cz>,
	linux-btrfs@vger.kernel.org, Qu Wenruo <wqu@suse.com>
Subject: Re: [PATCH] btrfs: validate scrub_speed_max sysfs string
Date: Wed, 13 Dec 2023 23:50:09 +0100	[thread overview]
Message-ID: <20231213225009.GI3001@twin.jikos.cz> (raw)
In-Reply-To: <7d72dca9-d995-40b8-a2f1-97f5526bccc4@gmx.com>

On Mon, Dec 11, 2023 at 01:48:15PM +1030, Qu Wenruo wrote:
> 
> 
> On 2023/12/8 11:11, David Disseldorp wrote:
> > Fail the sysfs I/O on any trailing non-space characters.
> >
> > Signed-off-by: David Disseldorp <ddiss@suse.de>
> 
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> 
> Although I have an unrelated idea.
> 
> Since memparse() provides the @endptr, can we rewind the @endptr, so
> that we can check if the last valid charactor is suffix 'e'.
> Then reject it from btrfs size.
> 
> I really don't think we need exabytes suffix for our scrub speed limit
> usage.

I think nobody will intentionally use the 'e' exabyte suffix in this
case but I don't want to add an exception to parsing the values. We'd
have to document that, explain why it's not accepted, it's additional
work for a case I still dont understand why it's so important.

If the exabyte scale values are not properly parsed by memparse() due to
simple_strtoull() as a workaround we can add our parser based on
kstrtoull() or do such change in memparse() proper.

  parent reply	other threads:[~2023-12-13 22:57 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
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 [this message]
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=20231213225009.GI3001@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=ddiss@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox