[PATCH] xfs_repair: junk last entry in sf dir if name starts beyond dir size
Rui Gomes
rgomes at rvx.is
Wed Mar 11 11:01:10 CDT 2015
Hi,
Thank you for pointing out where to look, I will try to dissect this a bit further and report back to you.
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 at sandeen.net>
To: "Rui Gomes" <rgomes at rvx.is>
Cc: "omar" <omar at rvx.is>, "xfs" <xfs at oss.sgi.com>
Sent: Wednesday, 11 March, 2015 15:46:50
Subject: Re: [PATCH] xfs_repair: junk last entry in sf dir if name starts beyond dir size
On 3/11/15 11:04 AM, Rui Gomes wrote:
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000044dbcd in __xfs_dir3_data_check (dp=dp at entry=0x0, bp=bp at 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 at entry=0x0, bp=bp at entry=0x1538e810) at xfs_dir2_data.c:148
> #1 0x000000000044b9ea in xfs_dir3_block_verify (bp=bp at entry=0x1538e810) at xfs_dir2_block.c:62
Can you do a little digging around in gdb to sort out more
about why it segfaulted?
We got a xfs_dir2_data_hdr_t from the passed-in bp w/ valid magic:
hdr = bp->b_addr;
and from that got btp:
switch (hdr->magic) {
case cpu_to_be32(XFS_DIR2_BLOCK_MAGIC):
btp = xfs_dir2_block_tail_p(mp, hdr);
and this just finds an offset from hdr:
((char *)hdr + mp->m_dirblksize)) - 1;
but then apparently blew up when we tried to use btp:
for (i = 0; i < be32_to_cpu(btp->count); i++) {
I don't see offhand how the hdr is ok, with good magic, but an
offset from the hdr (btp) is causing a segfault. Can you dig around
a bit more in gdb?
-Eric
More information about the xfs
mailing list