linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet@linux.dev>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-bcachefs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: [GIT PULL] bcachefs repair code for rc3
Date: Wed, 3 Apr 2024 15:22:53 -0400	[thread overview]
Message-ID: <nqkz5ed4k5vhhnmr5m32jydfgnon3hv7rj2vl6jywz6h44cjqp@olraxajp3avu> (raw)

Hi Linus, another bcachefs pull for you - this one is the new repair
code.

Cheers,
Kent

The following changes since commit b3c7fd35c03c17a950737fb56a06b730a7962d28:

  bcachefs: On emergency shutdown, print out current journal sequence number (2024-04-01 01:07:24 -0400)

are available in the Git repository at:

  https://evilpiepirate.org/git/bcachefs.git tags/bcachefs-2024-04-03

for you to fetch changes up to 09d4c2acbf4c864fef0f520bbcba256c9a19102e:

  bcachefs: reconstruct_inode() (2024-04-03 14:46:51 -0400)

----------------------------------------------------------------
bcachefs repair code for 6.9-rc3

A couple more small fixes, and new repair code.

We can now automatically recover from arbitrary corrupted interior btree
nodes by scanning, and we can reconstruct metadata as needed to bring a
filesystem back into a working, consistent, read-write state and
preserve access to whatevver wasn't corrupted.

Meaning - you can blow away all metadata except for extents and dirents
leaf nodes, and repair will reconstruct everything else and give you
your data, and under the correct paths. If inodes are missing i_size
will be slightly off and permissions/ownership/timestamps will be gone,
and we do still need the snapshots btree if snapshots were in use - in
the future we'll be able to guess the snapshot tree structure in some
situations.

IOW - aside from shaking out remaining bugs (fuzz testing is still
coming), repair code should be complete and if repair ever doesn't work
that's the highest priority bug that I want to know about immediately.

This patchset was kindly tested by a user from India who accidentally
wiped one drive out of a three drive filesystem with no replication on
the family computer - it took a couple weeks but we got everything
important back.

----------------------------------------------------------------
Guenter Roeck (1):
      mean_and_variance: Drop always failing tests

Kent Overstreet (18):
      bcachefs: Fix btree node reserve
      bcachefs: BCH_WATERMARK_interior_updates
      bcachefs: fix nocow lock deadlock
      bcachefs: Improve bch2_btree_update_to_text()
      bcachefs: Check for bad needs_discard before doing discard
      bcachefs: ratelimit informational fsck errors
      bcachefs: Clear recovery_passes_required as they complete without errors
      bcachefs: bch2_shoot_down_journal_keys()
      bcachefs: Etyzinger cleanups
      bcachefs: bch2_btree_root_alloc() -> bch2_btree_root_alloc_fake()
      bcachefs: Don't skip fake btree roots in fsck
      bcachefs: Repair pass for scanning for btree nodes
      bcachefs: Topology repair now uses nodes found by scanning to fill holes
      bcachefs: Flag btrees with missing data
      bcachefs: Reconstruct missing snapshot nodes
      bcachefs: Check for extents that point to same space
      bcachefs: Subvolume reconstruction
      bcachefs: reconstruct_inode()

 fs/bcachefs/Makefile                 |   2 +
 fs/bcachefs/alloc_background.c       |  47 ++--
 fs/bcachefs/alloc_foreground.c       |   4 +-
 fs/bcachefs/alloc_types.h            |   3 +-
 fs/bcachefs/backpointers.c           | 173 +++++++++++-
 fs/bcachefs/bcachefs.h               |   5 +
 fs/bcachefs/bcachefs_format.h        |   1 +
 fs/bcachefs/btree_gc.c               | 306 ++++++++++++++--------
 fs/bcachefs/btree_io.c               |  15 +-
 fs/bcachefs/btree_journal_iter.c     |  19 ++
 fs/bcachefs/btree_journal_iter.h     |   4 +
 fs/bcachefs/btree_node_scan.c        | 495 +++++++++++++++++++++++++++++++++++
 fs/bcachefs/btree_node_scan.h        |  11 +
 fs/bcachefs/btree_node_scan_types.h  |  30 +++
 fs/bcachefs/btree_trans_commit.c     |   3 +-
 fs/bcachefs/btree_update_interior.c  |  57 ++--
 fs/bcachefs/btree_update_interior.h  |  26 +-
 fs/bcachefs/buckets.h                |   1 +
 fs/bcachefs/data_update.c            |   3 +-
 fs/bcachefs/extents.c                |  52 ++--
 fs/bcachefs/extents.h                |   1 +
 fs/bcachefs/eytzinger.c              | 234 +++++++++++++++++
 fs/bcachefs/eytzinger.h              |  63 +++--
 fs/bcachefs/fsck.c                   | 227 ++++++++++++++--
 fs/bcachefs/journal_seq_blacklist.c  |   3 +-
 fs/bcachefs/mean_and_variance_test.c |  28 +-
 fs/bcachefs/opts.h                   |   4 +-
 fs/bcachefs/recovery.c               | 108 +++++---
 fs/bcachefs/recovery.h               |   2 +
 fs/bcachefs/recovery_passes.c        |  42 ++-
 fs/bcachefs/recovery_passes_types.h  |   2 +
 fs/bcachefs/replicas.c               |  19 +-
 fs/bcachefs/sb-errors_types.h        |   5 +-
 fs/bcachefs/snapshot.c               | 173 +++++++++++-
 fs/bcachefs/snapshot.h               |  26 +-
 fs/bcachefs/super-io.c               |   9 +-
 fs/bcachefs/super.c                  |   3 +
 fs/bcachefs/util.c                   | 143 ----------
 fs/bcachefs/util.h                   |  14 +-
 39 files changed, 1869 insertions(+), 494 deletions(-)
 create mode 100644 fs/bcachefs/btree_node_scan.c
 create mode 100644 fs/bcachefs/btree_node_scan.h
 create mode 100644 fs/bcachefs/btree_node_scan_types.h
 create mode 100644 fs/bcachefs/eytzinger.c

             reply	other threads:[~2024-04-03 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 19:22 Kent Overstreet [this message]
2024-04-04 22:58 ` [GIT PULL] bcachefs repair code for rc3 pr-tracker-bot

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=nqkz5ed4k5vhhnmr5m32jydfgnon3hv7rj2vl6jywz6h44cjqp@olraxajp3avu \
    --to=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).