Skip to contentSkip to conversation

Somewhat borked filesystem in need of fixing

DISCUSSION Nuutti Kotivuori 2 participants 3 messages Nov 17, 2009 – Nov 18, 2009 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello,

I recently told here about a broken filesystem after btrfs-convert & friends and I was informed that this was a known bug and fixed in later releases. I should've reformatted the partition and copied in the files anew, but I didn't, since this isn't a crucial production system for me.

So, after a day or two, I got in a case where I had done a hibernate, several suspend/resume cycles and exhausted the swap space so OOM killer was running wild and stuff.

And I managed to get an endless stream of errors to the system log that looked more or less like this:

parent transid verify failed on 39620608 wanted 5946 found 5944

I don't know if I'd be able to reproduce the problem, if spending a lot of time on it, but atleast for now, this was just a one time off case.

So I rebooted the machine, and got the same stream of errors upon mounting the filesystem. 500 per second. So I tried fsck, and it gave the same error and promptly segmentation faulted. btrfs-image did the same I think (though I'm not sure about this one).

Anyhow, I'd love to have a more reliable btrfsck, that is able to fix all kinds of corruptions, even then ones that are "never supposed to happen". So, personally, I'd like to work on this issue until btrfsck is able to fix the filesystem in to perfect working order - or atleast in such a good state, that files can be copied off from it.

However, if you'd rather debug the mount problems, that can be done as well - though that's more of a problem since I will have to do it in a virtual machine as to not mess up my server.

Anyhow, long story short, here's the error reported by btrfsck:

---------------------------------------------------------------------------

$ sudo ./btrfsck /dev/mapper/perspire-root
parent transid verify failed on 39620608 wanted 5946 found 5944
Segmentation fault
---------------------------------------------------------------------------

And here's valgrind telling what goes awry:

---------------------------------------------------------------------------
parent transid verify failed on 39620608 wanted 5946 found 5944 ==17536== Invalid read of size 4

==17536==    at 0x40F9AB: btrfs_print_leaf (ctree.h:1411)
==17536==    by 0x40C066: btrfs_lookup_extent_info (extent-tree.c:1450)
==17536==    by 0x4023F2: check_extents (btrfsck.c:2509)
==17536==    by 0x405004: main (btrfsck.c:2829)

==17536== Address 0xc4 is not stack'd, malloc'd or (recently) free'd
---------------------------------------------------------------------------

This is with the current head of btrfs-progs-unstable.

Thank you in advance,
-- Naked

#1 lore raw
Quoted 4 lines · Nuutti Kotivuori

Hello,

I recently told here about a broken filesystem after btrfs-convert & friends and I was informed that this was a known bug and fixed in lat=

er

Quoted 1 line

releases. I should've reformatted the partition and copied in the fil=

es

Quoted 1 line

anew, but I didn't, since this isn't a crucial production system for =

me.

Quoted 3 lines

So, after a day or two, I got in a case where I had done a hibernate, several suspend/resume cycles and exhausted the swap space so OOM kil=

ler

Quoted 3 lines

was running wild and stuff.

And I managed to get an endless stream of errors to the system log th=

at

Quoted 5 lines

looked more or less like this:

=A0parent transid verify failed on 39620608 wanted 5946 found 5944

I don't know if I'd be able to reproduce the problem, if spending a l=

ot

Quoted 1 line

of time on it, but atleast for now, this was just a one time off case=

=2E

Quoted 9 lines

So I rebooted the machine, and got the same stream of errors upon mounting the filesystem. 500 per second. So I tried fsck, and it gave the same error and promptly segmentation faulted. btrfs-image did the same I think (though I'm not sure about this one).

Anyhow, I'd love to have a more reliable btrfsck, that is able to fix all kinds of corruptions, even then ones that are "never supposed to happen". So, personally, I'd like to work on this issue until btrfsck=

is

Quoted 1 line

able to fix the filesystem in to perfect working order - or atleast i=

n

Quoted 3 lines

such a good state, that files can be copied off from it.

However, if you'd rather debug the mount problems, that can be done a=

s

Quoted 1 line

well - though that's more of a problem since I will have to do it in =

a

Quoted 5 lines

virtual machine as to not mess up my server.

Anyhow, long story short, here's the error reported by btrfsck:

---------------------------------------------------------------------=

------

Quoted 4 lines
$ sudo ./btrfsck /dev/mapper/perspire-root
parent transid verify failed on 39620608 wanted 5946 found 5944
Segmentation fault
---------------------------------------------------------------------=

------

Quoted 4 lines

And here's valgrind telling what goes awry:

---------------------------------------------------------------------=

------

Quoted 4 lines

parent transid verify failed on 39620608 wanted 5946 found 5944 =3D=3D17536=3D=3D Invalid read of size 4
=3D=3D17536=3D=3D =A0 =A0at 0x40F9AB: btrfs_print_leaf (ctree.h:1411) =3D=3D17536=3D=3D =A0 =A0by 0x40C066: btrfs_lookup_extent_info (exten=

t-tree.c:1450)

Quoted 3 lines

=3D=3D17536=3D=3D =A0 =A0by 0x4023F2: check_extents (btrfsck.c:2509) =3D=3D17536=3D=3D =A0 =A0by 0x405004: main (btrfsck.c:2829) =3D=3D17536=3D=3D =A0Address 0xc4 is not stack'd, malloc'd or (recent=

ly) free'd

Quoted 1 line

---------------------------------------------------------------------=

------

Quoted 3 lines

This is with the current head of btrfs-progs-unstable.

You can try mounting the FS in read only mode and copying files out. If you still get that error, try making verify_parent_transid() in disk= -io.c
always return 0. These are all we can do now.

Yan, Zheng
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 3 lines · Zheng

You can try mounting the FS in read only mode and copying files out. If you still get that error, try making verify_parent_transid() in disk-io.c always return 0. These are all we can do now.

Tried mounting it in read only mode, same problem:

  [176994.933016] __ratelimit: 92171 callbacks suppressed
  [176994.933021] parent transid verify failed on 39669760 wanted 5946 found 5944

However, I will keep the filesystem in storage, so you can tell me when you wish to start working on the btrfsck side of things. I can run different test versions and help debug things until btrfsck is able to fix the filesystem.

Personally, I consider the biggest barrier in adopting new filesystems for use to be the quality of their fsck. Checksums and metadata checksums do not help against programmatic corruption of data structures
- and in my opinion, that will happen at some point, either via bugs in the code or memory corruption - and a filesystem needs to be able to survive that.

-- Naked