Bug 204083 - reproducible mount failure on first mount after unclean shutdown
Summary: reproducible mount failure on first mount after unclean shutdown
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 low
Assignee: BTRFS virtual assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-07 00:18 UTC by bugzilla.kernel.org
Modified: 2019-07-07 00:19 UTC (History)
0 users

See Also:
Kernel Version: 4.14.7, 4.19.37
Tree: Mainline
Regression: No


Attachments

Description bugzilla.kernel.org 2019-07-07 00:18:03 UTC
For a while now, unclean shutdowns have a very high chance of making btrfs fail on first mount attempt at next boot, with "open_ctree failed" and no other error.

May  3 21:54:39 cerebro kernel: [  300.959175] BTRFS info (device dm-11): disk space caching is enabled
May  3 21:54:39 cerebro kernel: [  300.959874] BTRFS info (device dm-11): has skinny extents
May  3 21:54:39 cerebro kernel: [  300.976649] BTRFS error (device dm-11): open_ctree failed

Simply reissuing the exact same mount command (or rebooting for another attempt) "fixes" this, and the mount(s) succeed from then on, as normal, with no visible data loss or other problem:

May  3 21:54:39 cerebro kernel: [  354.553949] BTRFS info (device dm-11): disk space caching is enabled
May  3 21:54:39 cerebro kernel: [  354.554763] BTRFS info (device dm-11): has skinny extents

It seems to happen almost always for filesystems on dmcrypt+dmcache, but I have seen it on my ssd with just dmcrypt as well (all disks have write-cache disabled, and the unclean shutdown can be simulated by pressing reset, so unlikely  a power-outage problem).
Comment 1 bugzilla.kernel.org 2019-07-07 00:19:43 UTC
PS: it can also happen when I manually simulate a crash by destroying the dm-cache table entry, which makes it even less likely to be a hardware/sync problem as device mapper should atomically cut off all the devices from btrfs with no low-level data loss.

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