[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1015295: linux-image-5.10.0-16-arm64: Unbootable system due to F2FS sanity_check_inode errors after upgrading kernel



The entire issue appears to revolve around the fact that since commit:
  - f2fs: fix to do sanity check for inline inode
https://github.com/torvalds/linux/commit/677a82b44ebf263d4f9a0cfbd576a6ade797a07b

inodes with both inline_data and encrypted flags active would be
considered invalid. The same would apply with inline_data and
compression flags.

This was followed by a fix:
  - f2fs: attach inline_data after setting compression
https://github.com/torvalds/linux/commit/4cde00d50707c2ef6647b9b96b2cb40b6eb24397

But now that I look at this commit I can see that the changes were made
to functions:
  - f2fs_new_inode(...)
  - set_compress_inode(...)

Which would imply that this fix is probably intended to only prevent
new inodes from being created with invalid flag combinations.

I incorrectly assumed that this fix would also transparently repair
already existing invalid inodes, which were created by previous kernels
(when it was not considered invalid, and everything worked anyway).

So if my partition already had invalid inodes created by previous
kernel, the only way to fix that would be to use fsck offline from
f2fs-tools, which included this commit:
  - fsck.f2fs: drop compression bit if inline_data is set
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?h=dev&id=a74143858542ac733de92479f1f3d8a5984c1340

And as I have mentioned in my previous message this course of action
did work.

In this case, while this issue was caused by in-kernel change, wouldn't
it be more appropriate to move this bug to f2fs-tools?

Once a new version of f2fs-tools is released (1.15.1, or more likely
1.16.0), push it to Debian, and backport to Bullseye.

After all, the kernel error message hints to use fsck:
"%s: inode (ino=%lx, mode=%u) should not have inline_data, run fsck to
fix"

But obviously both f2fs-tools 1.14.0 from Debian, and newest 1.15.0, do
not see this as a problem, reporting no issues, and a vicious circle
begins.


Reply to: