On 2025/2/22 9:24, Hongbo Li wrote:
Checking the i_size of the last directory entry when fsck.

Fixes: b9ddb3e1a8aa ("bcachefs: Fix fsck directory i_size checking")
Signed-off-by: Hongbo Li <[email protected]>
---
  fs/bcachefs/fsck.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 9bf316e7b845..a9480bb308b2 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -2470,7 +2470,8 @@ int bch2_check_dirents(struct bch_fs *c)
                                POS(BCACHEFS_ROOT_INO, 0),
                                BTREE_ITER_prefetch|BTREE_ITER_all_snapshots, k,
                        check_dirent(trans, &iter, k, &hash_info, &dir, &target, 
&s)) ?:
-               check_subdir_count_notnested(trans, &dir));
+               check_subdir_count_notnested(trans, &dir) ?:
+               check_dir_i_size_notnested(trans, &dir));
Hi, Kent
  I mentioned this issue in [1], and it needs to be fixed.:)

[1] https://lore.kernel.org/linux-bcachefs/[email protected]/T/#t

        snapshots_seen_exit(&s);
        inode_walker_exit(&dir);

Reply via email to