btrfs-progs icon indicating copy to clipboard operation
btrfs-progs copied to clipboard

btrfs-progs: add rudimentary log checking

Open maharmstone opened this issue 1 year ago • 1 comments

Currently the transaction log is more or less ignored by btrfs check, meaning that it's possible for a FS with a corrupt log to pass btrfs check, but be immediately corrupted by the kernel when it's mounted.

This patch adds a check that if there's an inode in the log, any pending writes also have corresponding csum entries.

maharmstone avatar Aug 21 '24 10:08 maharmstone

Resubmission of log-checking patch

maharmstone avatar Aug 21 '24 10:08 maharmstone

Thanks Qu. I've pushed a version with the changes made.

maharmstone avatar Sep 03 '24 15:09 maharmstone

Looks good to me, only a minor problem related to the commit message, and I can definitely fix that at merge time:

any pending non-compressed writes also have corresponding csum entries.

There is nothing special requiring the logged write to be compressed or not, it just requires non-inline csumed writes.

adam900710 avatar Sep 04 '24 09:09 adam900710

Thanks Qu. Yes, that's left over from the first draft, it should have been taken out.

maharmstone avatar Sep 04 '24 09:09 maharmstone