bcachefs: Dirent repair code
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 21 Aug 2018 23:42:00 +0000 (19:42 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:09 +0000 (17:08 -0400)
commit741daa5be5c8d9cccaaac9759eb99893f1beb09b
tree591117f79d088e55a2c71261db6883aba4005731
parentcbdf24cef19be489f6885cecb4887fe407cebdfc
bcachefs: Dirent repair code

There was a bug for awhile in previous kernels where we weren't
computing dirent name lengths correctly and we weren't zeroing out
padding at the end of dirents (due to struct bch_dirent changing size by
adding __attribute__((aligned)), and not updating other code to use
offsetof).

This patch fixes dirents with junk at the end, by going off of the
dirent's hash.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/dirent.c
fs/bcachefs/dirent.h
fs/bcachefs/fsck.c