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

Rui Gomes
2015-03-11T15:04:08Z

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

Hello Eric,

After applying that patch I get yet another Segmentation Fault in a different place, gdb bt and output in the attachment.

Just in case this help, bellow the inode right before the segmentation fault:

xfs_db -c "inode 620507648" -c "p" /dev/sdb1
Metadata corruption detected at block 0x4ffed6d08/0x1000
xfs_db: cannot init perag data (117). Continuing anyway.
core.magic = 0x494e
core.mode = 040755
core.version = 2
core.format = 2 (extents)
core.nlinkv2 = 3
core.onlink = 0
core.projid_lo = 0
core.projid_hi = 0
core.uid = 0
core.gid = 0
core.flushiter = 2
core.atime.sec = Fri May 16 12:21:52 2014
core.atime.nsec = 779442171
core.mtime.sec = Tue Mar 24 12:03:59 2009
core.mtime.nsec = 000000000
core.ctime.sec = Fri Feb 28 19:54:03 2014
core.ctime.nsec = 736630717
core.size = 4096
core.nblocks = 1
core.extsize = 0
core.nextents = 1
core.naextents = 0
core.forkoff = 0
core.aformat = 2 (extents)
core.dmevmask = 0
core.dmstate = 0
core.newrtbm = 0
core.prealloc = 0
core.realtime = 0
core.immutable = 0
core.append = 0
core.sync = 0
core.noatime = 0
core.nodump = 0
core.rtinherit = 0
core.projinherit = 0
core.nosymlinks = 0
core.extsz = 0
core.extszinherit = 0
core.nodefrag = 0
core.filestream = 0
core.gen = 3064228498
next_unlinked = null
u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,38781727,1,0]

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: "omar" <omar@rvx.is>, "xfs" <xfs@oss.sgi.com>
Sent: Wednesday, 11 March, 2015 14:44:41
Subject: Re: [PATCH] xfs_repair: junk last entry in sf dir if name starts beyond dir size

On 3/11/15 10:26 AM, Rui Gomes wrote:
> 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.

If you have 4k sectors, you might need this patch from the list:

[PATCH] xfs: superblock buffers need to be sector sized

http://marc.info/?l=linux-xfs&m=142476196802097&w=2

as it's not merged yet.

-Eric

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

TRUCATED:

imap claims a free inode 620334717 is in use, correcting imap and clearing inode
cleared inode 620334717
imap claims a free inode 620334718 is in use, correcting imap and clearing inode
cleared inode 620334718
bad inode format in inode 620334719
cleared inode 620334719
Metadata corruption detected at block 0x127e18f8/0x1000
bad directory block magic # 0x414f0749 in block 0 for directory inode 620507648
corrupt block 0 in directory inode 620507648
will junk block
no . entry for directory 620507648
no .. entry for directory 620507648
problem with directory contents in inode 620507648
cleared inode 620507648

Program received signal SIGSEGV, Segmentation fault.
0x000000000044dbcd in __xfs_dir3_data_check (dp=dp@entry=0x0, bp=bp@entry=0x1538e810) at xfs_dir2_data.c:148
148 for (i = 0; i < be32_to_cpu(btp->count); i++) {
(gdb) bt
#0 0x000000000044dbcd in __xfs_dir3_data_check (dp=dp@entry=0x0, bp=bp@entry=0x1538e810) at xfs_dir2_data.c:148
#1 0x000000000044b9ea in xfs_dir3_block_verify (bp=bp@entry=0x1538e810) at xfs_dir2_block.c:62
#2 0x000000000044bb07 in xfs_dir3_block_read_verify (bp=0x1538e810) at xfs_dir2_block.c:76
#3 0x000000000042fd83 in libxfs_readbuf_verify (ops=0x46f550 <xfs_dir3_block_buf_ops>, bp=0x1538e810) at rdwr.c:756
#4 libxfs_readbuf (btp=0x695af0, blkno=310253808, len=8, flags=0, ops=0x46f550 <xfs_dir3_block_buf_ops>) at rdwr.c:802
#5 0x000000000042ff45 in libxfs_readbuf_map (btp=<optimized out>, map=map@entry=0x7fffffffd770, nmaps=nmaps@entry=1, flags=flags@entry=0, ops=<optimized out>) at rdwr.c:846
#6 0x0000000000411885 in da_read_buf (mp=mp@entry=0x7fffffffdfd0, nex=1, bmp=<optimized out>, ops=<optimized out>) at dir2.c:122
#7 0x00000000004131d0 in process_block_dir2 (dip=0x1538ed00, dino_dirty=0x7fffffffdc00, dirname=0x468732 "", repair=<synthetic pointer>, dotdot=0x7fffffffd864, dot=0x7fffffffd860, blkmap=0x6938c0, parent=0x7fffffffdc08,
ino_discovery=1, ino=620507651, mp=0x7fffffffdfd0) at dir2.c:1606
#8 process_dir2 (mp=mp@entry=0x7fffffffdfd0, ino=ino@entry=620507651, dip=dip@entry=0x1538ed00, ino_discovery=ino_discovery@entry=1, dino_dirty=dino_dirty@entry=0x7fffffffdc00, dirname=dirname@entry=0x468732 "",
parent=parent@entry=0x7fffffffdc08, blkmap=0x6938c0) at dir2.c:2018
#9 0x00000000004112a4 in process_dinode_int (mp=mp@entry=0x7fffffffdfd0, dino=dino@entry=0x1538ed00, agno=agno@entry=0, ino=ino@entry=620507651, was_free=<optimized out>, dirty=dirty@entry=0x7fffffffdc00,
used=used@entry=0x7fffffffdbfc, verify_mode=verify_mode@entry=0, uncertain=uncertain@entry=0, ino_discovery=ino_discovery@entry=1, check_dups=check_dups@entry=0, extra_attr_check=extra_attr_check@entry=1,
isa_dir=isa_dir@entry=0x7fffffffdc04, parent=parent@entry=0x7fffffffdc08) at dinode.c:2629
#10 0x00000000004116be in process_dinode (mp=mp@entry=0x7fffffffdfd0, dino=dino@entry=0x1538ed00, agno=agno@entry=0, ino=ino@entry=620507651, was_free=<optimized out>, dirty=dirty@entry=0x7fffffffdc00, used=used@entry=0x7fffffffdbfc,
ino_discovery=ino_discovery@entry=1, check_dups=check_dups@entry=0, extra_attr_check=extra_attr_check@entry=1, isa_dir=isa_dir@entry=0x7fffffffdc04, parent=parent@entry=0x7fffffffdc08) at dinode.c:2737
#11 0x000000000040b77f in process_inode_chunk (mp=mp@entry=0x7fffffffdfd0, agno=agno@entry=0, first_irec=first_irec@entry=0x7fffd8712190, ino_discovery=ino_discovery@entry=1, check_dups=check_dups@entry=0,
extra_attr_check=extra_attr_check@entry=1, bogus=bogus@entry=0x7fffffffdc8c, num_inos=<optimized out>) at dino_chunks.c:772
#12 0x000000000040cbad in process_aginodes (mp=0x7fffffffdfd0, pf_args=pf_args@entry=0x0, agno=agno@entry=0, ino_discovery=ino_discovery@entry=1, check_dups=check_dups@entry=0, extra_attr_check=extra_attr_check@entry=1)
at dino_chunks.c:1025
#13 0x00000000004186fe in process_ag_func (wq=0x7fffffffdd60, agno=0, arg=0x0) at phase3.c:77
#14 0x00000000004256ca in prefetch_ag_range (work=0x7fffffffdd60, start_ag=<optimized out>, end_ag=32, dirs_only=false, func=0x4186b0 <process_ag_func>) at prefetch.c:906
#15 0x000000000042582b in do_inode_prefetch (mp=mp@entry=0x7fffffffdfd0, stride=0, func=func@entry=0x4186b0 <process_ag_func>, check_cache=check_cache@entry=false, dirs_only=dirs_only@entry=false) at prefetch.c:969
#16 0x000000000041880d in process_ags (mp=0x7fffffffdfd0) at phase3.c:85
#17 phase3 (mp=mp@entry=0x7fffffffdfd0) at phase3.c:121
#18 0x0000000000403656 in main (argc=<optimized out>, argv=<optimized out>) at xfs_repair.c:789
(gdb)

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