linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH v3 0/8] New rescue mount options
Date: Fri,  9 Oct 2020 16:07:12 -0400	[thread overview]
Message-ID: <cover.1602273837.git.josef@toxicpanda.com> (raw)

v2->v3:
- Re-worked the showmount format for rescue= options, so it's in the format of
  rescue=option1:option2:option3.
- Added aliases for ignore* with just a i<opt>.
- Added a sysfs file to spit out supported rescue options.
- Fixed where we weren't spitting out rescue=usebackuproot in showmount.
- The only thing I didn't do was the no/^ options, since that's trickier and
  puts us in a murky place for some things (nonologreplay).

v1->v2:
- Add Qu's reviewed-bys.
- Addressed the comment about dev extent verification for ignorebadroots.

--- Original email ---
Hello,

This is the next version of my rescue=all patches, this time broken up in to a
few discrete patches, with some cleanups as well.  I have a PR for the xfstest
that exercises these options, it can be found here

  https://github.com/btrfs/fstests/pull/35

This is the same idea as the previous versions, except I've made a mechanical
change.  Instead we have rescue=ignorebadroots, which ignores any global roots
that we may not be able to read.  We will still fail to mount if thinks like the
chunk root or the tree root are corrupt, but this will allow us to mount read
only if the extent root or csum root are completely hosed.

I've added a new patch this go around, rescue=ignoredatacsums.  Somebody had
indicated that they would prefer that the original rescue=all allowed us to
continue to read csums if the root was still intact.  In order to handle that
usecase that's what you get with rescue=ignorebadroots, however if your csum
tree is corrupt in the middle of the tree you could still end up with problems.
Thus we have rescue=ignoredatacsums which will completely disable the csum tree
as well.

And finally we have rescue=all, which simply enables ignoredatacsums,
ignorebadroots, and notreelogreplay.  We need an easy catch-all option for
distros to fallback on to get users the highest probability of being able to
recover their data, so we will use rescue=all to turn on all the fanciest rescue
options that we have, and then use the discrete options for more fine grained
recovery.  Thanks,

Josef

Josef Bacik (8):
  btrfs: unify the ro checking for mount options
  btrfs: push the NODATASUM check into btrfs_lookup_bio_sums
  btrfs: add a supported_rescue_options file to sysfs
  btrfs: add a helper to print out rescue= options
  btrfs: show rescue=usebackuproot in /proc/mounts
  btrfs: introduce rescue=ignorebadroots
  btrfs: introduce rescue=ignoredatacsums
  btrfs: introduce rescue=all

 fs/btrfs/block-group.c | 48 +++++++++++++++++++++++++++
 fs/btrfs/block-rsv.c   |  8 +++++
 fs/btrfs/compression.c | 17 ++++------
 fs/btrfs/ctree.h       |  2 ++
 fs/btrfs/disk-io.c     | 74 +++++++++++++++++++++++++++---------------
 fs/btrfs/file-item.c   |  4 +++
 fs/btrfs/inode.c       | 18 +++++++---
 fs/btrfs/super.c       | 65 ++++++++++++++++++++++++++++++++-----
 fs/btrfs/sysfs.c       | 25 ++++++++++++++
 fs/btrfs/volumes.c     | 13 ++++++++
 10 files changed, 224 insertions(+), 50 deletions(-)

-- 
2.26.2


             reply	other threads:[~2020-10-09 20:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 20:07 Josef Bacik [this message]
2020-10-09 20:07 ` [PATCH v3 1/8] btrfs: unify the ro checking for mount options Josef Bacik
2020-10-12 10:54   ` Johannes Thumshirn
2020-10-09 20:07 ` [PATCH v3 2/8] btrfs: push the NODATASUM check into btrfs_lookup_bio_sums Josef Bacik
2020-10-12 10:55   ` Johannes Thumshirn
2020-10-09 20:07 ` [PATCH v3 3/8] btrfs: add a supported_rescue_options file to sysfs Josef Bacik
2020-10-10  0:34   ` Qu Wenruo
2020-10-12 10:57   ` Johannes Thumshirn
2020-10-09 20:07 ` [PATCH v3 4/8] btrfs: add a helper to print out rescue= options Josef Bacik
2020-10-12 10:50   ` Johannes Thumshirn
2020-10-09 20:07 ` [PATCH v3 5/8] btrfs: show rescue=usebackuproot in /proc/mounts Josef Bacik
2020-10-10  0:35   ` Qu Wenruo
2020-10-09 20:07 ` [PATCH v3 6/8] btrfs: introduce rescue=ignorebadroots Josef Bacik
2020-10-09 20:07 ` [PATCH v3 7/8] btrfs: introduce rescue=ignoredatacsums Josef Bacik
2020-10-09 20:07 ` [PATCH v3 8/8] btrfs: introduce rescue=all Josef Bacik

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=cover.1602273837.git.josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --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).