You are not logged in.

#1 Today 09:07:31

brattok
Member
Registered: Today
Posts: 1

[Ext4 / NVMe] Filesystem corruption and NMI after exiting hibernation

Hello everyone!

Recently I ran into an issue where my ext4 filesystem gets corrupted, and I've narrowed the trigger down specifically to system hibernation. I am usually able to fix it by running fsck from an Arch Live USB, and sometimes the system manages to repair it automatically during boot.

My system specs:
    - Laptop: Honor Notebook M1010 (HYM-WXX)
    - CPU: AMD Ryzen 5 5600H
    - GPU: AMD Radeon Graphics (Cezanne / Vega) using amdgpu driver
    - RAM: 16 GB
    - Storage: Samsung MZVL2512HCJQ-00B00 (NVMe)
    - Kernel: 7.1.5-arch1-1

Hibernation setup:
    - Initramfs: booster
    - Swap: 14GB dedicated swap partition (/dev/nvme0n1p8) and a 4GB zram block.
    - Relevant kernel parameters: zswap.enabled=0 rootfstype=ext4 resume=UUID=a9655007-51d3-4df2-9eed-2205dfbe70f8 nvme_core.default_ps_max_latency_us=0

Here is the log of going into hibernation and exiting it. After a couple of minutes upon waking up, the kernel receives an NMI. I skipped the user-space log junk between the hibernation exit and the NMI message to keep it clean.

https://pastebin.com/hbfiXyXK

After the NMI occurred, the system remained up and didn't go into hibernation or suspend until the next day. Later the following filesystem errors popped up:

Aug 21 07:59:51 archlinux kernel: EXT4-fs error (device nvme0n1p6): ext4_validate_block_bitmap:423: comm kworker/u48:4: bg 274: bad block bitmap checksum
Aug 21 07:59:51 archlinux kernel: EXT4-fs (nvme0n1p6): Delayed block allocation failed for inode 6695821 at logical offset 0 with max blocks 758 with error 74
Aug 21 07:59:51 archlinux kernel: EXT4-fs (nvme0n1p6): This should not happen!! Data will be lost

Later, after a reboot, the system refused to boot entirely, and I had to recover the filesystem using an Arch Live USB.

Another important detail:
I track my drive using smartctl, and I noticed that the NVMe logs an "unsafe shutdown" specifically upon hibernation. It never does this during a normal poweroff or reboot. I also already have

nvme_core.default_ps_max_latency_us=0

set to disable APST, but the issue persists.

Does anyone have suggestions on how to debug this NVMe power state issue or any possible fixes? Any help would be greatly appreciated!

Offline

#2 Today 16:35:12

xerxes_
Member
Registered: 2018-04-29
Posts: 1,070

Re: [Ext4 / NVMe] Filesystem corruption and NMI after exiting hibernation

Unsafe shutdown from your nvme drive's log after hibernation suggest that it is not safe to do hibernation - better turn it off. Your system should be powerful enough to boot and shutdown fast.

BTW how many do you have these "unsafe shutdowns" in nvme log? Is this amount related to number of hibernations? If it is a lot less number, then maybe something changed recently: bios update, arch linux update changed something, etc...?

Last edited by xerxes_ (Today 16:36:24)

Offline

Board footer

Powered by FluxBB