Re: [PATCH] xfs_repair: junk last entry in sf dir if name starts beyond dir size

Rui Gomes
2015-03-11T14:26:20Z

[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]

Hello Eric,

Thank you for the quick reply yesterday, I got to try the new patched version today,
and we have now a segmentation fault at a different stage of the repair \o/
Full output plus gdb traceback in the attachment.

Regards

-------------------------------
Rui Gomes
CTO

RVX - Reykjavik Visual Effects
Seljavegur 2,
101 Reykjavik
Iceland

Tel: + 354 527 3330
Mob: + 354 663 3360

----- Original Message -----
From: "Eric Sandeen" <sandeen@sandeen.net>
To: "Rui Gomes" <rgomes@rvx.is>
Cc: "xfs" <xfs@oss.sgi.com>
Sent: Tuesday, 10 March, 2015 17:37:03
Subject: Re: [PATCH] xfs_repair: junk last entry in sf dir if name starts beyond dir size

On 3/10/15 1:27 PM, Rui Gomes wrote:
> Hello Eric,
>
> I clone the xfs git "git://oss.sgi.com/xfs/cmds/xfsprogs" and I couldn't find the code in any of the branch's
> Is the code in a public available git?

The latest userspae code is currently at git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

The patch I sent applies on top of that, it's not yet been committed to the repo.
The patch as sent should get you through your segfault, but we'll probably end
up merging something a bit different.

-Eric

[-- Attachment #2: xfs_gdb.txt --]
[-- Type: text/plain, Size: 3679 bytes --]

[root@icess8a repair]# gdb ./xfs_repair
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/xfsprogs-dev/repair/xfs_repair...done.
(gdb) run -L -P -vvv /dev/sdb1
Starting program: /root/xfsprogs-dev/repair/./xfs_repair -L -P -vvv /dev/sdb1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Phase 1 - find and verify superblock...
- max_mem = 24562701, icount = 22628224, imem = 88391, dblock = 3904294144, dmem = 1906393
- block cache size set to 2814736 entries
Phase 2 - using internal log
- zero log...
zero_log: head block 8 tail block 8
- scan filesystem freespace and inode maps...
[New Thread 0x7fffef950700 (LWP 7732)]
[New Thread 0x7fffef14f700 (LWP 7733)]
[New Thread 0x7fffee94e700 (LWP 7734)]
[New Thread 0x7fffee14d700 (LWP 7735)]
[New Thread 0x7fffed94c700 (LWP 7736)]
[New Thread 0x7fffed14b700 (LWP 7737)]
[New Thread 0x7fffec94a700 (LWP 7738)]
[New Thread 0x7fffec149700 (LWP 7739)]
[New Thread 0x7fffeb948700 (LWP 7740)]
[New Thread 0x7fffeb147700 (LWP 7741)]
[New Thread 0x7fffea946700 (LWP 7742)]
[New Thread 0x7fffea145700 (LWP 7743)]
[New Thread 0x7fffe9944700 (LWP 7744)]
[New Thread 0x7fffe9143700 (LWP 7745)]
[New Thread 0x7fffe8942700 (LWP 7746)]
[New Thread 0x7fffe8141700 (LWP 7747)]
[New Thread 0x7fffe7940700 (LWP 7748)]
[New Thread 0x7fffe713f700 (LWP 7749)]
[New Thread 0x7fffe693e700 (LWP 7750)]
[New Thread 0x7fffe613d700 (LWP 7751)]
[New Thread 0x7fffe593c700 (LWP 7752)]
[New Thread 0x7fffe513b700 (LWP 7753)]
[New Thread 0x7fffe493a700 (LWP 7754)]
[New Thread 0x7fffe4139700 (LWP 7755)]
[New Thread 0x7fffe3938700 (LWP 7756)]
[New Thread 0x7fffe3137700 (LWP 7757)]
[New Thread 0x7fffe2936700 (LWP 7758)]
[New Thread 0x7fffe2135700 (LWP 7759)]
[New Thread 0x7fffe1934700 (LWP 7760)]
[New Thread 0x7fffe1133700 (LWP 7761)]
[New Thread 0x7fffe0932700 (LWP 7762)]
[New Thread 0x7fffe0131700 (LWP 7763)]
SB sanity check failed
Metadata corruption detected at block 0x4ffed6d00/0x1000
Metadata corruption detected at block 0x4ffed6d08/0x1000
bad on-disk superblock 22 - inconsistent filesystem geometry information
primary/secondary superblock 22 conflict - AG superblock geometry info conflicts with filesystem geometry
zeroing unused portion of secondary superblock (AG #22)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeb147700 (LWP 7741)]
__memset_sse2 () at ../sysdeps/x86_64/memset.S:873
873 movdqa %xmm0,(%rdi)
(gdb) bt
#0 __memset_sse2 () at ../sysdeps/x86_64/memset.S:873
#1 0x000000000040407b in secondary_sb_wack (mp=0x7fffffffdfc0, sbuf=0x553b01a7, i=22, sb=0x7fffa00008c0) at agheader.c:313
#2 verify_set_agheader (mp=0x7fffffffdfc0, sbuf=sbuf@entry=0x7fffa0000ad0, sb=sb@entry=0x7fffa00008c0, agf=agf@entry=0x7fffa0001e00, agi=agi@entry=0x7fffa0003000, i=i@entry=22) at agheader.c:523
#3 0x0000000000427beb in scan_ag (wq=<optimized out>, agno=22, arg=0x68eb90) at scan.c:1523
#4 0x000000000042a36a in worker_thread (arg=0x7fffffffdcd0) at threads.c:46
#5 0x00007ffff77badf3 in start_thread (arg=0x7fffeb147700) at pthread_create.c:308
#6 0x00007ffff74e81ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

[-- Attachment #3: Type: text/plain, Size: 121 bytes --]