bcachefs: Fix repair for extent past end of inode
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 17 Jul 2022 03:31:28 +0000 (23:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:35 +0000 (17:09 -0400)
commit0d06b4eca687b3a6a07b62fd4ca83d635103c77f
tree67ef96dcae0bbef01308674b8a20c384d15b999d
parentc7a09cb1b13995da938f4e1df52adeba44515d7d
bcachefs: Fix repair for extent past end of inode

When we find an extent past an inode's i_size, we need to do the
deletion in the inode's snapshot (which will emit a whiteout if
necessary); and we also need to note that we now have an a key at that
position and snapshot, so that we don't go into an infinite loop.

Also, switch to walking inodes in reverse older, oldest snapshot to
newest, so that we emit the fewest whiteouts possible.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/fsck.c