linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/2] btrfs: verify max_inline mount parameter
Date: Thu, 15 Feb 2018 01:20:55 +0800	[thread overview]
Message-ID: <74fb8a4b-24d7-7871-8050-2c4e3113580c@oracle.com> (raw)
In-Reply-To: <20180213162822.GW3003@twin.jikos.cz>



On 02/14/2018 12:28 AM, David Sterba wrote:
> On Tue, Feb 13, 2018 at 05:49:50PM +0800, Anand Jain wrote:
>> We aren't verifying the parameter passed to the max_inline mount option,
>> so we won't report and fail the mount if a junk value is specified for
>> example, -o max_inline=abc.
>> This patch converts the max_inline option to %d and checks if it's a
>> number >= 0.
> 
> As the max_inline is a size, the suffixes are allowed here and this is
> documented in the btrfs(5) page. I've checked all current options and
> max_inline should be the only one where we want the suffixes.

  Oh. I ran out of ideas how to fix this.
  One idea is ... step1: memparse() 4K (for example) so we would get
  4096, step2: convert obtained 4096 back to 4K and step3: do string cmp
  of step1 and step2. This way we eliminate other junk chars passed.
  But looks like there isn't any tool to do the step2.

Thanks, Anand

> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2018-02-14 17:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13  9:49 [PATCH v2 1/2] btrfs: declare max_inline as u32 Anand Jain
2018-02-13  9:49 ` [PATCH v2 2/2] btrfs: verify max_inline mount parameter Anand Jain
2018-02-13 16:28   ` David Sterba
2018-02-14 17:20     ` Anand Jain [this message]
2018-02-15 16:43       ` David Sterba
2018-02-26  2:47         ` [PATCH v3] " Anand Jain
2018-02-27 15:45           ` David Sterba
2018-03-01 11:51             ` Anand Jain
2018-03-05 21:34               ` David Sterba
2018-02-13 16:28 ` [PATCH v2 1/2] btrfs: declare max_inline as u32 David Sterba

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=74fb8a4b-24d7-7871-8050-2c4e3113580c@oracle.com \
    --to=anand.jain@oracle.com \
    --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;
as well as URLs for NNTP newsgroup(s).