Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 760573 - sys-kernel/gentoo-sources-5.10.1 causes filesystem corruption for F2FS
Summary: sys-kernel/gentoo-sources-5.10.1 causes filesystem corruption for F2FS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
Depends on:
Reported: 2020-12-18 01:07 UTC by Stefan de Konink
Modified: 2020-12-21 15:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Stefan de Konink 2020-12-18 01:07:21 UTC
I am using F2FS as my root filesystem. Today I upgraded from 5.9.11-gentoo to 5.10.1-gentoo. After I upgraded glibc programs could not find Long story short at least /etc/env.d/00glibc and /etc/nsswitch.conf became corrupt, and when on kernel 5.10.1-gentoo I could consistently cause the problems below (twice including a reboot, filesystem checked with a LiveCD). When switching back to 5.9.11-gentoo, upgrading glibc did not cause any further issues.

[  701.466276] WARNING: CPU: 4 PID: 66867 at fs/f2fs/checkpoint.c:189 f2fs_is_valid_blkaddr+0x25f/0x270[
[  701.469213] Modules linked in: cmac bnep joydev zfs(PO) zunicode(PO) zzstd(O) zlua(O) zavl(PO) icp(PO) uvcvideo videobuf2_vmalloc ath10k_pci videobuf2_memops videobuf2_v4l2 snd_usb_audio btusb snd_hwdep zcommon(PO) btrtl snd_usbmidi_lib ath10k_core videodev znvpair(PO) btbcm wmi_bmof ath snd_rawmidi videobuf2_common btintel spl(O) bluetooth ecdh_generic amdgpu kvm_amd zlib_deflate ecc zlib_inflate mac80211 kvm irqbypass snd_hda_codec_conexant snd_hda_codec_generic snd_hda_codec_hdmi aesni_intel crypto_simd mfd_core cryptd snd_hda_intel gpu_sched glue_helper snd_intel_dspcfg evdev psmouse snd_hda_codec ttm i2c_algo_bit sdhci_pci snd_hda_core drm_kms_helper iosf_mbi syscopyarea sysfillrect sysimgblt snd_pcm fb_sys_fops cec cqhci snd_timer ccp sdhci cfg80211 i2c_piix4 r8169 sha1_generic libarc4 mmc_core realtek thinkpad_acpi mdio_devres libphy nvram wireguard ledtrig_audio ip6_udp_tunnel snd udp_tunnel soundcore wmi rfkill ac battery video i2c_scmi button sch_fq_codel drm backlight i2c_core
[  701.469299]  efivarfs
[  701.486729] CPU: 4 PID: 66867 Comm: python3.7m Tainted: P        W  O      5.10.1-gentoo #1
[  701.489555] Hardware name: LENOVO 20KU000NMH/20KU000NMH, BIOS R0UET77W (1.57 ) 04/07/2020
[  701.492291] RIP: 0010:f2fs_is_valid_blkaddr+0x25f/0x270
[  701.494964] Code: 41 f7 41 30 44 01 c0 39 c6 73 09 41 8b 41 5c e9 fe fe ff ff 89 f2 48 89 df 48 c7 c6 fa e4 f5 81 e8 80 f9 41 00 f0 80 4b 48 04 <0f> 0b 31 c0 5b c3 0f 0b 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[  701.497674] RSP: 0018:ffffc9000f83fe70 EFLAGS: 00010282
[  701.500374] RAX: 0000000000000000 RBX: ffff888101a6f000 RCX: 0000000000000000
[  701.502979] RDX: 0000000000000000 RSI: ffff88844ef12d40 RDI: ffff88844ef12d40
[  701.505524] RBP: 0000000000000001 R08: ffffffff8226b1e8 R09: 00000000fffff7ff
[  701.508011] R10: ffffffff8225f200 R11: 00000000fffff800 R12: ffff8881433d9640
[  701.510494] R13: 0000160000000000 R14: 0000000000001000 R15: 0000000000000003
[  701.512878] FS:  00007f581c2ef740(0000) GS:ffff88844ef00000(0000) knlGS:0000000000000000
[  701.515216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  701.517499] CR2: 00007f581ba40000 CR3: 0000000174626000 CR4: 00000000003506e0
[  701.519792] Call Trace:
[  701.521970]  f2fs_llseek+0x23e/0x490
[  701.524089]  __x64_sys_lseek+0x82/0xc0
[  701.526205]  do_syscall_64+0x33/0x40
[  701.528258]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[  701.530299] RIP: 0033:0x7f581c87d377
[  701.532256] Code: 00 00 90 48 8b 15 f1 ca 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b2 66 2e 0f 1f 84 00 00 00 00 00 90 b8 08 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 c1 ca 0c 00 f7 d8 64 89 02 48
[  701.534269] RSP: 002b:00007fffc5549628 EFLAGS: 00000202 ORIG_RAX: 0000000000000008
[  701.536267] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f581c87d377
[  701.538258] RDX: 0000000000000003 RSI: 0000000000000000 RDI: 0000000000000003
[  701.540295] RBP: 00007fffc5549680 R08: 0000000000000000 R09: 00007fffc55492f0
[  701.542268] R10: 00007fffc55492f0 R11: 0000000000000202 R12: 0000000000000003
[  701.544178] R13: 0000000000000004 R14: 0000000000000002 R15: 00007fffc5549680
[  701.546029] ---[ end trace a0930f5707057a19 ]---
[  701.548199] F2FS-fs (sda4): access invalid blkaddr:539167267
[  701.550010] ------------[ cut here ]------------

Reproducible: Always

Steps to Reproduce:
1. upgrade to gentoo-sources-5.10.2
2. compile glibc
Actual Results:  
Corruption in several files, causing full system to break.

Expected Results:  
No filesystem corruption.

Portage 3.0.12 (python 3.7.9-final-0, default/linux/amd64/17.1/no-multilib, gcc-10.2.0, glibc-2.32-r5, 5.9.11-gentoo x86_64)
System uname: Linux-5.9.11-gentoo-x86_64-AMD_Ryzen_5_2500U_with_Radeon_Vega_Mobile_Gfx-with-gentoo-2.7
KiB Mem:    16091196 total,  12685316 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Thu, 17 Dec 2020 09:00:01 +0000
Head commit of repository gentoo: e39e9485642fb9fa78e75b9cdfca3a3a75aadbd3
sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
ccache version 4.1 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18-r100::lto-overlay, 3.7.9-r1::lto-overlay
dev-util/ccache:          4.1::gentoo
dev-util/cmake:           3.19.1::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo, 2.33.1-r1::gentoo, 2.34-r2::gentoo, 2.35.1-r1::gentoo
sys-devel/gcc:            10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r5::gentoo

    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

    location: /var/lib/layman/4nykey
    masters: gentoo
    priority: 50

    location: /var/lib/layman/booboo
    masters: gentoo
    priority: 50

    location: /var/lib/layman/d3-gentoo
    masters: gentoo
    priority: 50

    location: /var/lib/layman/dotnet
    masters: gentoo
    priority: 50

    location: /var/lib/layman/flavour
    masters: gentoo
    priority: 50

    location: /var/lib/layman/fordfrog
    masters: gentoo
    priority: 50

    location: /var/lib/layman/gentoo-zh
    masters: gentoo
    priority: 50

    location: /var/lib/layman/imaging
    masters: gentoo
    priority: 50

    location: /var/lib/layman/lto-overlay
    masters: gentoo mv
    priority: 50

    location: /var/lib/layman/mv
    masters: gentoo
    priority: 50

    location: /var/lib/layman/raiagent
    masters: gentoo
    priority: 50

    location: /var/lib/layman/salfter
    masters: gentoo
    priority: 50

    location: /var/lib/layman/FireBurn
    masters: gentoo
    priority: 60

ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O2 -march=znver1 -O2 -pipe -pipe"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=znver1 -O2 -pipe -pipe"
FCFLAGS="-O2 -march=znver1 -O2 -pipe -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=znver1 -O2 -pipe -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
USE="X acl adwaita-icon-theme alsa amd64 autohint berkdb bluetooth brotli bzip2 cairo caps clang cli codec2 corefonts cpudetection crypt curl dav1d dbus designer dri dri3 egl exif ffmpeg fftw fontconfig fortran gdal gdbm geos gimp gles2 glslang gold graphite gtk gtk3 hackrf harfbuzz heif http2 iconv icu infinality ipv6 jack jpeg jpeg2k jumbo-build lapack libglvnd libnotify libsamplerate libtirpc lm-sensors lto lz4 lzma minizip ncurses nptl ogg opencl opencv openexr opengl openmp optimization opus orc pam pcre pdf pgo png policykit postgres qml qt5 readline rtlsdr rubberband seccomp sndfile speex split-usr sqlite srt ssl startup-notification strong-optimization svg synaptics system-jsoncpp system-libvpx systemd sysv-utils tcpd theora tiff tracepath truetype udev unicode upower vaapi vdpau vim-syntax vorbis vpx vulkan webp webstart woff2 x264 x265 xattr xinerama xrandr zeromq zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en nl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres13" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby27" USERLAND="GNU" UWSGI_PLUGINS="cache carbon cheaper_busyness corerouter fastrouter http logfile logsocket mongodblog nagios ping rawrouter redislog router_basicauth router_cache router_expires router_hash router_http router_memcached router_metrics router_redirect router_redis router_rewrite router_static router_uwsgi rpc signal spooler symcall syslog transformation_chunked transformation_gzip transformation_offload transformation_tofile ugreen zergpool" VIDEO_CARDS="amdgpu radeonsi radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 1 Stefan de Konink 2020-12-18 14:30:11 UTC
Tomáš Mózes what is the reason you reduce the severity from critical to normal? "The software crashes, hangs, or causes you to lose data." fits the description closely.
Comment 2 Larry the Git Cow gentoo-dev 2020-12-18 16:40:58 UTC
The bug has been closed via the following commit(s):

commit 2b2f30c42a60ab75dd5de3cf1d411006f018b6d8
Author:     Mike Pagano <>
AuthorDate: 2020-12-18 16:40:45 +0000
Commit:     Mike Pagano <>
CommitDate: 2020-12-18 16:40:45 +0000

    sys-kernel/gentoo-sources: f2fs: fix data corruption bug
    Thanks to Stefan de Konink for reporting
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Mike Pagano <>

 sys-kernel/gentoo-sources/Manifest                 |  3 +++
 .../gentoo-sources/gentoo-sources-5.10.1-r1.ebuild | 29 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
Comment 3 Tomáš Mózes 2020-12-18 18:35:12 UTC
(In reply to Stefan de Konink from comment #1)
> Tomáš Mózes what is the reason you reduce the severity from critical to
> normal? "The software crashes, hangs, or causes you to lose data." fits the
> description closely.

Yes, but it's a testing version, it only happens on F2FS and 5.10 has been buggy since it came out ;)

Nevertheless it's fixed, however given the circumstances I would stick to a more stable release since 5.10 stepped out pretty bad.
Comment 4 nvaert1986 2020-12-21 15:46:42 UTC
I'd like to add that I've triggered the bug twice as well and can confirm that this patch resolves the issue.