• Kent Overstreet's avatar
    bcachefs: Improve transaction restart handling in fsck code · 285b181a
    Kent Overstreet authored
    The fsck code has been handling transaction restarts locally, to avoid
    calling fsck_err() multiple times (and asking the user/logging the error
    multiple times) on transaction restart.
    
    However, with our improving assertions about iterator validity, this
    isn't working anymore - the code wasn't entirely correct, in ways that
    are fine for now but are going to matter once we start wanting online
    fsck.
    
    This code converts much of the fsck code to handle transaction restarts
    in a more rigorously correct way - moving restart handling up to the top
    level of check_dirent, check_xattr and others - at the cost of logging
    errors multiple times on transaction restart.
    
    Fixing the issues with logging errors multiple times is probably going
    to require memoizing calls to fsck_err() - we'll leave that for future
    improvements.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
    285b181a
dirent.c 13.3 KB