Skip to content

self healing: inode <-> dirent checks

Kent Overstreet linux-bcachefs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bcachefs: fs-common.c -> namei.cfs/bcachefs/Makefile fs/bcachefs/error.c fs/bcachefs/fs-ioctl.c +5 more+10 -100 replies
2/4bcachefs: Move bch2_check_dirent_target() to namei.cfs/bcachefs/dirent.c fs/bcachefs/dirent.h fs/bcachefs/fsck.c +2 more+236 -2240 replies
3/4bcachefs: Refactor bch2_check_dirent_target()fs/bcachefs/fsck.c fs/bcachefs/inode.h fs/bcachefs/namei.c +1 more+94 -680 replies
4/4bcachefs: Run bch2_check_dirent_target() at lookup timefs/bcachefs/fs.c+17 -150 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] self healing: inode <-> dirent checks

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%)
Signature · 1 line
2.49.0