Re: xfs_repair segfaults

Eric Sandeen
2013-03-12T14:47:55Z

On 3/12/13 6:37 AM, Ole Tange wrote:

> $ ~/work/xfsprogs/repair/xfs_repair -L franklin.img
> Phase 1 - find and verify superblock...
> Phase 2 - using internal log
> - zero log...
> ALERT: The filesystem has valuable metadata changes in a log which is being
> destroyed because the -L option was used.
> - scan filesystem freespace and inode maps...
> xfs_repair: scan.c:1080: scan_freelist: Assertion `0' failed.
> Aborted (core dumped)

Oh, man. I need to have my hacker card revoked. Or maybe focus
on one filesystem at a time so I don't keep doing dumb things, like
adding an unconditional ASSERT in non-"-n"-mode. Holy cow, I don't
know what's up with me lately. :/

Anyway, just modify these 2 lines in repair/scan.c to remove the ASSERT
around line 1080.

I'll send a proper patch as well.

diff --git a/repair/scan.c b/repair/scan.c
index 6a62dff..76bb7f1 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -1076,8 +1076,7 @@ scan_freelist(
"freelist scan\n"), i);
return;
}
- } else /* should have been fixed in verify_set_agf() */
- ASSERT(0);
+ }

count = 0;
for (;;) {