All of lore.kernel.org
 help / color / mirror / Atom feed
* [btrfs-progs] btrfs check --clear-space-cache v2 segfaults
@ 2020-09-03 14:56 Althorion
  2020-09-03 17:54 ` Chris Murphy
  0 siblings, 1 reply; 2+ messages in thread
From: Althorion @ 2020-09-03 14:56 UTC (permalink / raw)
  To: linux-btrfs

Hi!

My BTRFS partition started throwing errors and remounting read-only, with errors like:

Sep 02 14:49:44 ripper systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
Sep 02 14:50:56 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 82707480576; counted 1, expected 2
Sep 02 14:50:56 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 126730895360; counted 5, expected 6
Sep 02 14:50:56 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 131025862656; counted 0, expected 1
Sep 02 14:51:55 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 82707480576; counted 2, expected 3
Sep 02 14:51:55 ripper kernel: BTRFS: error (device sdc4) in convert_free_space_to_bitmaps:316: errno=-5 IO failure
Sep 02 14:51:55 ripper kernel: BTRFS info (device sdc4): forced readonly

I've tried running btrfs check --clear-space-cache to try and clear the second to last error, but it segfaulted after a few seconds.

OK, but I run Gentoo, so maybe it's something on my end, so I tried again from an Arch LiveCD, using btrfs-progs 5.7-1, and it segfaulted too.

What else should I try before wiping up the system and recreating from backup?





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [btrfs-progs] btrfs check --clear-space-cache v2 segfaults
  2020-09-03 14:56 [btrfs-progs] btrfs check --clear-space-cache v2 segfaults Althorion
@ 2020-09-03 17:54 ` Chris Murphy
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Murphy @ 2020-09-03 17:54 UTC (permalink / raw)
  To: Althorion; +Cc: linux-btrfs

On Thu, Sep 3, 2020 at 8:58 AM Althorion <althorion@protonmail.com> wrote:
>
> Hi!
>
> My BTRFS partition started throwing errors and remounting read-only, with errors like:
>
> Sep 02 14:49:44 ripper systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
> Sep 02 14:50:56 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 82707480576; counted 1, expected 2
> Sep 02 14:50:56 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 126730895360; counted 5, expected 6
> Sep 02 14:50:56 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 131025862656; counted 0, expected 1
> Sep 02 14:51:55 ripper kernel: BTRFS error (device sdc4): incorrect extent count for 82707480576; counted 2, expected 3
> Sep 02 14:51:55 ripper kernel: BTRFS: error (device sdc4) in convert_free_space_to_bitmaps:316: errno=-5 IO failure
> Sep 02 14:51:55 ripper kernel: BTRFS info (device sdc4): forced readonly
>
> I've tried running btrfs check --clear-space-cache to try and clear the second to last error, but it segfaulted after a few seconds.

Pretty much everything depends on the extent tree being healthy. Free
space bitmaps is a reference to v1, and are composed of data extents.
And v2 is its own btree, and use metadata extents.

While it probably shouldn't segfault in this case, it probably should
refuse making modifications to the extent tree that don't involve
repairing it. And in that sense it's better that it segfaulted than
attempting to modify a damaged extent tree.

> OK, but I run Gentoo, so maybe it's something on my end, so I tried again from an Arch LiveCD, using btrfs-progs 5.7-1, and it segfaulted too.
>
> What else should I try before wiping up the system and recreating from backup?

Well, once you're prepared to wipe it, you could give --repair a try
and see if it fixes anything. If not then the big hammer is
--init-extent-tree. If that completes (it'll take a while) without
error, then you'll want to run --repair afterward. But depending on
the size of the file system, wipe and restore might be faster.


-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-03 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 14:56 [btrfs-progs] btrfs check --clear-space-cache v2 segfaults Althorion
2020-09-03 17:54 ` Chris Murphy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.