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

Reply via email to