I am running Arch Linux on a system with full disk encryption and the storage is a Samsung 950 Pro NVMe drive (512 GB). The computer is a couple months old. No bad behavior until now. (I'm only using 21 GB of the 512 space on the disk.)btrfs-progs v4.5.1Today I was using my system normally and browsing the web. Firefox stopped responding suddenly and for no apparent reason. Then plasma stopped responding. I could not log out of KDE.I killed my user session (pkill -u me), then I tired to startx. At that point I noticed my root filesystem was read-only.As a first step, I rebooted. That didn't help anything.The root fs will not mount. Here is the error info:running hook [encrypt]performing fsck on /dev/mapper/cryptrootmounting /dev/mapper/cryptroot on real rootBTRFS error (device dm-0) in btrfs_replay_log: 2421: errno=-22 unknown (failed to recover log tree)BTRFS error (device dm-0): cleaner transaction attach returned -30BTRFS open_ctree failedmount: wrong fs type, bad option, bad superblock on /dev/mapper/cryptrootdropped into emergency shellI typed this by hand, so minor punctuation is the messages is not exact, etc.journalctl -p3 doesn't report anything that looks related to this.EDIT: multiple reboots don't resolve it. The error is still the same.I booted into a LiveUSB environment and ran this command:cryptsetup open --type luks /dev/xxx cryptrootmount -t btrfs -o noatime,nodiratime,ssd,compress=lzo,defaults,space_cache,subvolid=257 /dev/mapper/cryptroot /mntThe error message is also the same:[ 2300.967048] BTRFS info (device dm-0): use ssd allocation scheme[ 2300.967058] BTRFS info (device dm-0): use lzo compression[ 2300.967066] BTRFS info (device dm-0): disk space caching is enabled[ 2300.967069] BTRFS: has skinny extents[ 2300.995393] BTRFS: error (device dm-0) in btrfs_replay_log:2413: errno=-22 unknown (Failed to recover log tree)[ 2300.997617] BTRFS info (device dm-0): delayed_refs has NO entry[ 2300.997673] BTRFS error (device dm-0): cleaner transaction attach returned -30[ 2301.035405] BTRFS: open_ctree failedEDIT 2:Based on these two links:https://btrfs.wiki.kernel.org/index.php/Problem_FAQhttps://btrfs.wiki.kernel.org/index.php/Btrfs-zero-logI decided to take a chance on running this command:btrfs rescue zero-logThat worked and I can mount the filesystem.EDIT 3:I ran btrfs check --repair. Here is the output:root@broken / # umount /mnt root@broken / # btrfs check --repair /dev/mapper/cryptroot enabling repair modeChecking filesystem on /dev/mapper/cryptrootchecking extentsbad metadata [292414476288, 292414492672) crossing stripe boundarybad metadata [292414541824, 292414558208) crossing stripe boundarybad metadata [292414672896, 292414689280) crossing stripe boundarybad metadata [292414869504, 292414885888) crossing stripe boundarybad metadata [292415000576, 292415016960) crossing stripe boundarybad metadata [292415066112, 292415082496) crossing stripe boundarybad metadata [292415131648, 292415148032) crossing stripe boundarybad metadata [292415262720, 292415279104) crossing stripe boundarybad metadata [292415328256, 292415344640) crossing stripe boundarybad metadata [292415393792, 292415410176) crossing stripe boundaryrepaired damaged extent referencesFixed 0 roots.checking free space cachecache and super generation don't match, space cache will be invalidatedchecking fs rootschecking csumschecking root refschecking quota groupsIgnoring qgroup relation key 258Ignoring qgroup relation key 263Ignoring qgroup relation key 71776119061217538Ignoring qgroup relation key 71776119061217543Counts for qgroup id: 257 are differentour:            referenced 10412273664 referenced compressed 10412273664disk:           referenced 10411311104 referenced compressed 10411311104diff:           referenced 962560 referenced compressed 962560our:            exclusive 10412273664 exclusive compressed 10412273664disk:           exclusive 10412273664 exclusive compressed 10412273664found 21570773057 bytes used err is 0total csum bytes: 19563456total tree bytes: 403767296total fs tree bytes: 349667328total extent tree bytes: 27328512btree space waste bytes: 66313360file data blocks allocated: 39882014720referenced 28043988992extent buffer leak: start 20987904 len 16384extent buffer leak: start 292688068608 len 16384extent buffer leak: start 60915712 len 16384extent buffer leak: start 29569581056 len 16384extent buffer leak: start 29569597440 len 16384extent buffer leak: start 292412063744 len 16384extent buffer leak: start 292405870592 len 16384extent buffer leak: start 292405936128 len 16384extent buffer leak: start 292413964288 len 16384Then I checked dmesg and saw this error information:[ 4925.562422] BTRFS info (device dm-0): use ssd allocation scheme[ 4925.562432] BTRFS info (device dm-0): use lzo compression[ 4925.562440] BTRFS info (device dm-0): disk space caching is enabled[ 4925.562444] BTRFS: has skinny extents[ 4925.578705] BTRFS error (device dm-0): qgroup generation mismatch, marked as inconsistent[ 4925.584033] BTRFS: checking UUID treeMy questions:What caused this?What should I do next?Off-target Reference:https://wiki.archlinux.org/index.php/Btrfs#BTRFS:_open_ctree_failed(that doesn't seem to be my problem. I don't have a multi-device btrfs fs and I am not using btrfs in HOOKS in /etc/mkinitcpio.conf)
btrfs error unknown - root fs will not mount
filesystems;mount;btrfs;root filesystem;dm crypt