linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: dsterba@suse.cz, linux-btrfs@vger.kernel.org, vegard.nossum@oracle.com
Subject: Re: [PATCH 2/2] Btrfs: add valid checks for chunk loading
Date: Tue, 17 May 2016 15:37:30 +0200	[thread overview]
Message-ID: <20160517133730.GR511@twin.jikos.cz> (raw)
In-Reply-To: <20160513235717.GC27734@localhost.localdomain>

On Fri, May 13, 2016 at 04:57:17PM -0700, Liu Bo wrote:
> > > +								      chunk));
> > > +		return -EIO;
> > > +	}
> > >  	if (!length || !IS_ALIGNED(length, root->sectorsize)) {
> > >  		btrfs_err(root->fs_info,
> > >  			"invalid chunk length %llu", length);
> > >  		return -EIO;
> > >  	}
> > > -	if (!is_power_of_2(stripe_len)) {
> > > +	if (stripe_len != BTRFS_STRIPE_LEN) {
> > 
> > Again too strict. As mentined elsewhere, add a helper to validate
> > stripe_len and use it so we don't open-code it.
> 
> I'm not sure I understand the comment about open-code, right now
> the value must be BTRFS_STRIPE_LEN and we don't set any other value,
> are we going to add a helper for just (stripe_len != BTRFS_STRIPE_LEN)?

mkfs.btrfs will create stripesize == 4k, forcing this to
BTRFS_STRIPE_LEN will suddenly prevent mounting of lots of filesystems.
IIRC the stripe length check was done in several places so even if the
helper is simple we'll change the condition in one place once we'll
decide what are the acceptable values.

  reply	other threads:[~2016-05-17 13:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 18:15 [PATCH 1/2] Btrfs: add more valid checks for superblock Liu Bo
2016-05-02 18:15 ` [PATCH 2/2] Btrfs: add valid checks for chunk loading Liu Bo
2016-05-03  1:12   ` Qu Wenruo
2016-05-03 23:36     ` Liu Bo
2016-05-05  1:03       ` Qu Wenruo
2016-05-03  5:53   ` Anand Jain
2016-05-03 23:33     ` Liu Bo
2016-05-04 13:56   ` David Sterba
2016-05-13 23:57     ` Liu Bo
2016-05-17 13:37       ` David Sterba [this message]
2016-05-02 18:23 ` [PATCH 1/2] Btrfs: add more valid checks for superblock Liu Bo
2016-05-03  1:02 ` Qu Wenruo
2016-05-03 23:32   ` Liu Bo
2016-05-04 13:23   ` David Sterba
2016-05-04 17:44     ` Liu Bo
2016-05-05  1:08       ` Qu Wenruo
2016-05-06 14:35         ` David Sterba
2016-05-09  1:31           ` Qu Wenruo
2016-05-13 18:14             ` Liu Bo
2016-05-13 23:42               ` Qu Wenruo
2016-05-17 13:47                 ` David Sterba
2016-05-04 13:29 ` David Sterba
2016-05-04 17:40   ` Liu Bo
2016-05-06 14:39     ` 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=20160517133730.GR511@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=bo.li.liu@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=vegard.nossum@oracle.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;
as well as URLs for NNTP newsgroup(s).