http://oss.sgi.com/bugzilla/show_bug.cgi?id=402
Summary: xfs_repair Segmentation fault
Product: Linux XFS
Version: Current
Platform: IA32
OS/Version: Linux
Status: NEW
Severity: normal
Priority: High
Component: xfsprogs
AssignedTo: xfs-master@xxxxxxxxxxx
ReportedBy: lisg@xxxxxxxxxxx
Daggrass 2005-3-30 [lisg@xxxxxxxxxxx]
title :
origin : the last days, my xfs filesystem on server seem error, but it appear
"Segmentation fault" when I run xfs_repair.
The problem have solved now. but I don't know the true reason;
so I report it.
/* /dev/hda2 is xfs filesystem */
/* "server" is my hostname */
[root@server]# xfs_info /dev/hda2
meta-data=/home2 isize=256 agcount=10, agsize=1023943 blks
= sectsz=512
data = bsize=4096 blocks=10239429, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal bsize=4096 blocks=16384, version=1
= sectsz=512 sunit=0 blks
realtime =none extsz=65536 blocks=0, rtextents=0
/* first check the /dev/hda2 */
[root@server]# xfs_check /dev/hda2
(display info ):
#------------log of xfs_check -------------start
block 9/620534 out of range
block 9/620535 out of range
block 9/620536 out of range
...
... continuous
...
block 9/1024067 out of range
block 9/1024068 out of range
block 9/1024069 out of range
blocks 9/620534..1024069 claimed by block 9/1
block 9/620406 expected type free1 got unknown
block 9/620407 expected type free1 got unknown
block 9/620408 expected type free1 got unknown
...
... continuous
...
block 9/1023938 expected type free1 got unknown
block 9/1023939 expected type free1 got unknown
block 9/1023940 expected type free1 got unknown
block 9/1023941 expected type free1 got unknown
#----log of xfs_check -----------end, all info have line 807073
/* then try to repair it */
[root@server]# xfs_repair /dev/hda2
(display info ):
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
- scan filesystem freespace and inode maps...
Segmentation fault
/* so i get a source code copy by http://oss.sgi.com */
#2005-03-30 10:30
#[root@server]# cvs checkout xfs-cmds
/* Then I modify the file: xfs-cmds/xfsprogs/repair/scan.c */
#---------------diff-file--------------------start
#[root@server]# cvs diff scan.c > scan.c-diff
#[root@server]# more scan.c-diff
Index: scan.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsprogs/repair/scan.c,v
retrieving revision 1.9
diff -r1.9 scan.c
568a569,578
> if( b >= 1023984) {
> printf("Lisg %s %d : before
get_agbno_state, i:%d, b:%d, end:%d\n",
> __FILE__,
> __LINE__,
> i,
> b,
> INT_GET(rp
[i].ar_startblock, ARCH_CONVERT) + INT_GET(rp[i].ar_blockco
unt, ARCH_CONVERT)
> );
> continue;
> }
#---------------diff-file--------------------end
and then make ... execute
[root@server]# ./xfs_repair /dev/hda2
( It's ok ^_^, output info ):
[root@server]# ./xfs_repair /dev/hda2
#---------------log of xfs_repair -------------- start
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
- scan filesystem freespace and inode maps...
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023984, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023985, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023986, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023987, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023988, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023989, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023990, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023991, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023992, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023993, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023994, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023995, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023996, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023997, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023998, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1023999, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024000, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024001, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024002, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024003, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024004, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024005, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024006, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024007, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024008, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024009, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024010, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024011, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024012, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024013, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024014, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024015, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024016, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024017, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024018, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024019, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024020, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024021, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024022, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024023, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024024, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024025, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024026, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024027, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024028, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024029, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024030, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024031, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024032, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024033, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024034, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024035, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024036, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024037, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024038, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024039, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024040, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024041, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024042, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024043, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024044, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024045, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024046, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024047, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024048, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024049, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024050, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024051, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024052, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024053, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024054, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024055, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024056, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024057, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024058, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024059, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024060, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024061, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024062, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024063, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024064, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024065, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024066, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024067, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024068, end:1024070
Lisg scan.c 572 : before get_agbno_state, i:495, b:1024069, end:1024070
- found root inode chunk
Phase 3 - for each AG...
- scan and clear agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
- agno = 4
- agno = 5
- agno = 6
- agno = 7
- agno = 8
- agno = 9
- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- clear lost+found (if it exists) ...
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
- agno = 4
- agno = 5
- agno = 6
- agno = 7
- agno = 8
- agno = 9
Phase 5 - rebuild AG headers and trees...
- reset superblock...
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- ensuring existence of lost+found directory
- traversing filesystem starting at / ...
- traversal finished ...
- traversing all unattached subtrees ...
- traversals finished ...
- moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
done
#---------------log of xfs_repair -------------- end
herefrom, all is ok
[root@server]# xfs_check /dev/hda2
It isn't display info no longer.
[root@server]# xfs_repair /dev/hda2
Phase 1 - find and verify superblock...
...
done
It's ok.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
|