On Thu, Dec 19, 2019 at 1:07 PM Ralf Zerres <Ralf.Zerres@xxxxxxxxxxx> wrote: > > Dear list, > > at customer site i can't mount a given btrfs device in rw mode. > this is production data and i do have a backup and managed to mount the filesystem in ro mode. I did copy out relevant stuff. > Having said this, if btrfs --repair can't heal the situation, i could reformat the filesystem and start all over. > But i would prefere to save the time and take the heeling as a proof of "production ready" status of btrfs-progs. > > Here are the details: > > kernel: 5.2.2 (Ubuntu 18.04.3) Unfortunate that these versions are still easily obtained. 5.2.0 - 5.2.14 had an pernicious bug. I can't tell if it applies in your case though. Btrfs: fix unwritten extent buffers and hangs on future writeback attempts https://lore.kernel.org/linux-btrfs/20190911145542.1125-1-fdmanana@xxxxxxxxxx/T/#u The bug is fixed since 5.2.15. > btrfs-progs: 5.2.1 > # btrfs check --mode lowmem --progress --repair /dev/<mydev> > # enabling repair mode > # WARNING: low-memory mode repair support is only partial > # Opening filesystem to check... > # Checking filesystem on /dev/<mydev> > # UUID: <my UUID> > # [1/7] checking root items (0:00:33 elapsed, 20853512 items checked) > # Fixed 0 roots. > # ERROR: extent[1988733435904, 134217728] referencer count mismatch (root: 261, owner: 286, offset: 5905580032) wanted: # 28, have: 34 > # ERROR: fail to allocate new chunk No space left on device > # Try to exclude all metadata blcoks and extents, it may be slow > # Delete backref in extent [1988733435904 134217728]07:16 elapsed, 40435 items checked) > # ERROR: extent[1988733435904, 134217728] referencer count mismatch (root: 261, owner: 286, offset: 5905580032) wanted: 27, have: 34 > # Delete backref in extent [1988733435904 134217728] > # ERROR: extent[1988733435904, 134217728] referencer count mismatch (root: 261, owner: 286, offset: 5905580032) wanted: 26, have: 34 > # ERROR: commit_root already set when starting transaction > # ERROR: fail to start transaction: Invalid argument > # ERROR: extent[2017321811968, 134217728] referencer count mismatch (root: 261, owner: 287, offset: 2281701376) wanted: 3215, have: 3319 > # ERROR: commit_root already set when starting transaction > # ERROR: fail to start transaction Invalid argument > > This ends with a core-dump. Well it's easy to say a crash is a bug, and I'm also not sure if it's fixed in btrfs-progs 5.4. But it might help isolate the problem if you attach dmesg. At least the good news is there's a backup; but creating a new volume and restoring this much data will be a little tedious. -- Chris Murphy
