Bug 205181 - kernel panic when accessing btrfs root device with f2fs in kernel
Summary: kernel panic when accessing btrfs root device with f2fs in kernel
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: f2fs (show other bugs)
Hardware: All Linux
: P1 blocking
Assignee: Default virtual assignee for f2fs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-13 13:13 UTC by Roger
Modified: 2019-10-31 18:14 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.19.76-4.19.79
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Roger 2019-10-13 13:13:33 UTC
This happens on kernel versions 4.19.76-4.19.79 on x86_64 (Slackware):
With support for btrfs, f2fs, ext*, xfs and a few others compiled in kernel it panics when accessing a btrfs root device.
If support for f2fs is removed all works normally on 4.19.79, as does versions before 4.19.76.
The problem has been verified on different machines by different users.
Comment 2 Andrew Macks 2019-10-13 15:49:32 UTC
The issue is present in 4.14 longterm, 4.19 longterm and 5.2 stable EOL.

The cause is the following patch:

July 2: Original commit
  10f966bbf521bb9b2e497bbca496a5141f4071d0
  f2fs: use generic EFSBADCRC/EFSCORRUPTED

July 12: Merged into mainline with f2fs-for-5.3

July 28: Fix from Icenowy Zheng (read this for some background)
  38fb6d0ea34299d97b031ed64fe994158b6f8eb3
  f2fs: use EINVAL for superblock with invalid magic

July 30: Fix merged into mainline with f2fs-for-5.4-rc3 (note the typo in branch name, this was actually for 5.3-rc3)

September 15: Kernel 5.3 was born so already contained the fix.

It was backported into the relevant branches below:

October 1: Original commit merged into 5.2.18

  5.2.18 (5.2.19, 5.2.20, 5.2.21 EOL still affected)
  c704eb3aaffae0d6463b1773b37e69695b112ca4
  f2fs: use generic EFSBADCRC/EFSCORRUPTED

October 1: Original commit merged into 4.19.76

  4.19.76 (4.19.77, 4.19.78, 4.19.79 still affected)
  59a5cea41dd0ae706ab83f8ecd64199aadefb493
  f2fs: use generic EFSBADCRC/EFSCORRUPTED

October 5: Original commit merged into 4.14.147

  4.14.147 (4.14.148 and 4.14.149 still affected)
  e991f02f6f9117514ed1374b39ce195013ab9cd0
  f2fs: use generic EFSBADCRC/EFSCORRUPTED

...

Further notes:

* To date, 4.14, 4.19 and 5.2 all contain the issue.

* The f2fs development/stable kernel branches contain a fix (including their 4.14 and 4.19 branches), so the issue is not present there.

* Not quite sure why this commit was backported at all to longterm, but maybe I am missing some behavioural change which warranted it.  (To me, it seems like this was long-standing functionality already).
Comment 3 Roger 2019-10-13 16:19:25 UTC
Thanks for the reply.
This is a real mess for Slackware since we use "huge" kernels with support
for nearly every file system as default installation kernels. This particular flavour often remain as system default as it gets upgraded. This is how it was discovered, when someone upgraded his server with a btrfs root fs and a "huge" kernel.
Comment 4 Roger 2019-10-19 17:29:21 UTC
Thanks for the quick response
4.19.80 works just fine here :)
Comment 5 Andrew Macks 2019-10-31 18:14:11 UTC
Confirmed that 4.19.80 is fine also.  Sorry for the delayed reply.

Note You need to log in before you can comment on or make changes to this bug.