linux-bcachefs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] self healing: inode <-> dirent checks
@ 2025-03-20 21:30 Kent Overstreet
  2025-03-20 21:30 ` [PATCH 1/4] bcachefs: fs-common.c -> namei.c Kent Overstreet
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kent Overstreet @ 2025-03-20 21:30 UTC (permalink / raw)
  To: linux-bcachefs; +Cc: Kent Overstreet

there have been some sporadic reports of "dirent points to inode that
does not point back" errors.

the reports I've seen look harmless after repair; no deeper corruption
involved, the inode backpointer field is off and nothing else. we
haven't caught it in the act yet - i.e. found the transaction in the
journal that did it - but this is something self healing can cope with
fine until we get it root caused.

this series takes the fsck code and adds it to the lookup path - the
general strategy of self healing is "any time we've already lookup up
multiple keys, check the relationships between them whenever it doesn't
cost to do so".

note that self healing hasn't actually been flipped on yet; i.e. we
won't be repairing outside of fsck, just running the same checks fsck
does (and going ERO if they fire).

once this has been out there for a bit, we'll flip on self healing.

Kent Overstreet (4):
  bcachefs: fs-common.c -> namei.c
  bcachefs: Move bch2_check_dirent_target() to namei.c
  bcachefs: Refactor bch2_check_dirent_target()
  bcachefs: Run bch2_check_dirent_target() at lookup time

 fs/bcachefs/Makefile                 |   2 +-
 fs/bcachefs/dirent.c                 |  51 ++++++
 fs/bcachefs/dirent.h                 |   2 +
 fs/bcachefs/error.c                  |   2 +-
 fs/bcachefs/fs-ioctl.c               |   2 +-
 fs/bcachefs/fs.c                     |  34 ++--
 fs/bcachefs/fsck.c                   | 231 +--------------------------
 fs/bcachefs/inode.h                  |   1 +
 fs/bcachefs/{fs-common.c => namei.c} | 180 ++++++++++++++++++++-
 fs/bcachefs/{fs-common.h => namei.h} |  31 +++-
 fs/bcachefs/recovery.c               |   2 +-
 11 files changed, 289 insertions(+), 249 deletions(-)
 rename fs/bcachefs/{fs-common.c => namei.c} (75%)
 rename fs/bcachefs/{fs-common.h => namei.h} (61%)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-20 21:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-20 21:30 [PATCH 0/4] self healing: inode <-> dirent checks Kent Overstreet
2025-03-20 21:30 ` [PATCH 1/4] bcachefs: fs-common.c -> namei.c Kent Overstreet
2025-03-20 21:30 ` [PATCH 2/4] bcachefs: Move bch2_check_dirent_target() to namei.c Kent Overstreet
2025-03-20 21:30 ` [PATCH 3/4] bcachefs: Refactor bch2_check_dirent_target() Kent Overstreet
2025-03-20 21:30 ` [PATCH 4/4] bcachefs: Run bch2_check_dirent_target() at lookup time Kent Overstreet

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).