From: David Sterba <dave@jikos.cz>
To: Hugo Mills <hugo@carfax.org.uk>,
dsterba@suse.cz, David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 0/6] RAID1 with 3- and 4- copies
Date: Tue, 11 Jun 2019 11:53:15 +0200 [thread overview]
Message-ID: <20190611095314.GC24160@twin.jikos.cz> (raw)
In-Reply-To: <20190610144806.GB21016@carfax.org.uk>
On Mon, Jun 10, 2019 at 02:48:06PM +0000, Hugo Mills wrote:
> On Mon, Jun 10, 2019 at 04:02:36PM +0200, David Sterba wrote:
> > On Mon, Jun 10, 2019 at 12:42:26PM +0000, Hugo Mills wrote:
> > > Hi, David,
> > >
> > > On Mon, Jun 10, 2019 at 02:29:40PM +0200, David Sterba wrote:
> > > > this patchset brings the RAID1 with 3 and 4 copies as a separate
> > > > feature as outlined in V1
> > > > (https://lore.kernel.org/linux-btrfs/cover.1531503452.git.dsterba@suse.com/).
> > > [...]
> > > > Compatibility
> > > > ~~~~~~~~~~~~~
> > > >
> > > > The new block group types cost an incompatibility bit, so old kernel
> > > > will refuse to mount filesystem with RAID1C3 feature, ie. any chunk on
> > > > the filesystem with the new type.
> > > >
> > > > To upgrade existing filesystems use the balance filters eg. from RAID6
> > > >
> > > > $ btrfs balance start -mconvert=raid1c3 /path
> > > [...]
> > >
> > > If I do:
> > >
> > > $ btrfs balance start -mprofiles=raid13c,convert=raid1 \
> > > -dprofiles=raid13c,convert=raid6 /path
> > >
> > > will that clear the incompatibility bit?
> >
> > No the bit will stay, even though there are no chunks of the raid1c3
> > type. Same for raid5/6.
> >
> > Dropping the bit would need an extra pass trough all chunks after
> > balance, which is feasible and I don't see usability surprises. That you
> > ask means that the current behaviour is probably opposite to what users
> > expect.
>
> We've had a couple of cases in the past where people have tried out
> a new feature on a new kernel, then turned it off again and not been
> able to go back to an earlier kernel. Particularly in this case, I can
> see people being surprised at the trapdoor. "I don't have any RAID13C
> on this filesystem: why can't I go back to 5.2?"
Undoing the incompat bit is expensive in some cases, eg. for ZSTD this
would mean to scan all extents, but in case of the raid profiles it's
easy to check the list of space infos that are per-profile.
So, my current idea is to use the sysfs interface. The /features
directory lists the files representing features and writing 1 to the
file followed by a sync would trigger the rescan and drop the bit
eventually.
The meaning of the /sys/fs/btrfs/features/* is defined for 1, which
means 'can be set at runtime', so the ability to unset the feature would
be eg. 3, as a bitmask of possible actions (0b01 set, 0b10 unset).
We do have infrastructure for changing the state in a safe manner even
from sysfs, which sets a bit somewhere and commit processes that. That's
why the sync is required, but I don't think that's harming usability too
much.
next prev parent reply other threads:[~2019-06-11 10:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 12:29 [PATCH v2 0/6] RAID1 with 3- and 4- copies David Sterba
2019-06-10 12:29 ` [PATCH v2 1/6] btrfs: add mask for all RAID1 types David Sterba
2019-06-10 12:29 ` [PATCH v2 2/6] btrfs: use mask for RAID56 profiles David Sterba
2019-06-10 12:29 ` [PATCH v2 3/6] btrfs: document BTRFS_MAX_MIRRORS David Sterba
2019-06-10 12:29 ` [PATCH v2 4/6] btrfs: add support for 3-copy replication (raid1c3) David Sterba
2019-06-10 12:29 ` [PATCH v2 5/6] btrfs: add support for 4-copy replication (raid1c4) David Sterba
2019-06-10 12:29 ` [PATCH v2 6/6] btrfs: add incompat for raid1 with 3, 4 copies David Sterba
2019-06-10 12:29 ` [PATCH] btrfs-progs: add support for raid1c3 and raid1c4 David Sterba
2019-06-10 12:42 ` [PATCH v2 0/6] RAID1 with 3- and 4- copies Hugo Mills
2019-06-10 14:02 ` David Sterba
2019-06-10 14:48 ` Hugo Mills
2019-06-11 9:53 ` David Sterba [this message]
2019-06-11 12:03 ` David Sterba
2019-06-25 17:47 ` 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=20190611095314.GC24160@twin.jikos.cz \
--to=dave@jikos.cz \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=hugo@carfax.org.uk \
--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).