Hi Sam, thanks for looking into this.
Usually users mkfs on other platforms
Yes, that’s a way to not see the warning that mkfs shows, but my worries were more about the possibility that using metadata_csum in osmc could corrupt the fs.
Looking at 3.18, it looks like this could be the commit that ext4 utils refer to:
Yes, I had a look and that was the first one I saw too, and indeed it looks interesting to have it.
Since Linux 3.18 was released on 7 Dec 2014, I had a look at all commits done around that date on ext4 and jbd2 and noticed some that were also very interesting.
Here, jbd2: fix regression where we fail to initialize checksum seed when loading is a merge done by Linus on 2014-12-01 (merge for 3.18 of a regression introduced in 3.18-rc3) of a checksum related issue in the journal.
Note that this mail by Theodore Ts’o mentions “the metadata csum v3 patches that went in in 3.18-rc3” requiring an updated e2fsprogs, so I would say the warning by mkfs actually refers to many patches (in plural) and not just one fix in particular.
Reviewing the commits on ext4 and jbd2 mentioned above, I found these that look interesting and probably are worth backporting (if they’re not backported already):
jbd2: fix infinite loop when recovering corrupt journal blocks (2014-08-27)
jbd2: fix descriptor block size handling errors with journal_csum (2014-08-27)
I think this is the important patch. Note that the commit log says:
It turns out that there are some serious problems with the on-disk
format of journal checksum v2. The foremost is that the function to
calculate descriptor tag size returns sizes that are too big. This
causes alignment issues on some architectures and is compounded by the
fact that some parts of jbd2 use the structure size (incorrectly) to
determine the presence of a 64bit journal instead of checking the
feature flags.
Therefore, introduce journal checksum v3, which enlarges the
descriptor block tag format to allow for full 32-bit checksums of
journal blocks, fix the journal tag function to return the correct
sizes, and fix the jbd2 recovery code to use feature flags to
determine 64bitness.
[...]
I previously interpreted that mail by Theodore mentioned above as talking about v3 of some patches, but it seems it refers to v3 of the journal checksum format.
jbd2: fix journal checksum feature flag handling (2014-09-11)
jbd2: free bh when descriptor block checksum fails (2014-09-16)
ext4: Replace open coded mdata csum feature to helper function (2014-10-13) This is just some refactoring, but probably useful to ease the backporting of further commits and the commit mentions it also protects from errors [...] which may result attempt to use uninitialized csum machinery'
so I’d say it’s interesting to backport.
ext4: check s_chksum_driver when looking for bg csum presence (2014-10-14)
ext4: fix oops when loading block bitmap failed (2014-10-30)
jbd2: use a better hash function for the revoke table (2014-10-30)