Skip to content

New rescue mount options

Josef Bacik linux-btrfs 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest8 patches 5 repliesIn review
  2. v38 patches 6 repliesSuperseded
  3. v25 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches12 repliesSuperseded

Changes in v4 from the cover letter

- Add more reviewed-bys.
- Addressed Johannes's comment about the helper for spitting out the rescue options in showmount.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8btrfs: unify the ro checking for mount optionsfs/btrfs/super.c+16 -70 replies
2/8btrfs: push the NODATASUM check into btrfs_lookup_bio_sumsfs/btrfs/compression.c fs/btrfs/file-item.c fs/btrfs/inode.c+17 -120 replies
3/8btrfs: add a supported_rescue_options file to sysfsfs/btrfs/sysfs.c+22 -00 replies
4/8btrfs: add a helper to print out rescue= optionsfs/btrfs/super.c+9 -11 reply
5/8btrfs: show rescue=usebackuproot in /proc/mountsfs/btrfs/super.c+2 -03 replies
6/8btrfs: introduce rescue=ignorebadrootsfs/btrfs/block-group.c fs/btrfs/block-rsv.c fs/btrfs/compression.c +7 more+132 -280 replies
7/8btrfs: introduce rescue=ignoredatacsumsfs/btrfs/ctree.h fs/btrfs/disk-io.c fs/btrfs/super.c +1 more+27 -100 replies
8/8btrfs: introduce rescue=allfs/btrfs/super.c fs/btrfs/sysfs.c+12 -01 reply

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchJohannes ThumshirnQu Wenruo
1/8R-b R-b
2/8R-b R-b
3/8R-b
4/8R-b
5/8R-b
6/8
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/8] New rescue mount options

v3->v4:
- Add more reviewed-bys.
- Addressed Johannes's comment about the helper for spitting out the rescue options in showmount.

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       | 68 +++++++++++++++++++++++++++++++++-----
 fs/btrfs/sysfs.c       | 25 ++++++++++++++
 fs/btrfs/volumes.c     | 13 ++++++++
 10 files changed, 228 insertions(+), 49 deletions(-)
Signature · 1 line
2.26.2