Re: something very strange w/ filestreams...

Barry Naujok
2007-09-25T00:13:35Z

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

On Mon, 24 Sep 2007 22:40:45 +1000, Eric Sandeen <sandeen@sandeen.net>
wrote:

> Barry Naujok wrote:
>> On Sun, 23 Sep 2007 19:24:44 +1000, David Chinner <dgc@sgi.com> wrote:
>>
>>> Barry - I think xfs_repair might be finding the incorrect superblock
>>> for the repair. Tests 172, 173 and 174 use less than the whole disk,
>>> so there are going to be stale superblocks all over the place....
>>>
>>>> hm, no zone name, length of 0x22222274?
>>>>
>>>> I already provided a metadump image to Barry, but I wonder why the
>>>> timing(?) seems to make a difference here... first sign of things
>>>> going
>>>> awry in repair is:
>>>>
>>>> Phase 2 - using internal log
>>>> - zero log...
>>>> - scan filesystem freespace and inode maps...
>>>> bad length 131072 for agf 0, should be 4096
>>>> bad length # 131072 for agi 0, should be 4096
>>> Yes - test 173 uses 1GB filesystem with 64x16MB AGs - 4096 * 4k block
>>> size = 16MB AG. definitely looks like a stale superblock being
>>> found.
>>>
>>> Barry, I think that the secondary superblock needs better verification
>>> (e.g. that there really are AG headers where the sb says there
>>> are supposed to be and all the lengths match up).
>>>
>>> Eric - you can relax. Filestreams is not hosing your filesystem;
>>> xfs_reapir
>>> is....
>>
>> Test 178 is designed to test mkfs.xfs in
>> http://oss.sgi.com/archives/xfs/2007-07/msg00139.html and
>> will still make xfs_repair go bananas if there is other
>> old AG headers.
>>
>> So, before running this test, you should make sure your test
>> partitions are completely zeroed from mkfs's that occurred
>> before that recent version of mkfs.xfs was installed.
>
> I dd'd over the whole test partition, ran the sequence, and hit the
> problem.

Yeah, worked it out yesterday but never got around to doing another
email. It's a combination of the two filestreams tests which do
small filesystems and mkfs.xfs doesn't wipe beyond the new
filesystem size. Zero the disk, try the attached patch and see
if that fixes the problem.

Barry.

[-- Attachment #2: better_ag_zeroing_in_mkfs.patch --]
[-- Type: application/octet-stream, Size: 881 bytes --]

--- a/xfsprogs/mkfs/xfs_mkfs.c 2007-09-25 10:12:42.000000000 +1000
+++ b/xfsprogs/mkfs/xfs_mkfs.c 2007-09-25 10:11:36.955516729 +1000
@@ -558,15 +558,12 @@ zero_old_xfs_structures(
goto done;

/*
- * block size and basic geometry seems alright, zero the secondaries,
- * but don't go beyond the end of the new filesystem.
+ * block size and basic geometry seems alright, zero the secondaries.
*/
bzero(buf, new_sb->sb_sectsize);
off = 0;
for (i = 1; i < sb.sb_agcount; i++) {
off += sb.sb_agblocks;
- if (off >= new_sb->sb_dblocks)
- break;
if (pwrite64(xi->dfd, buf, new_sb->sb_sectsize,
off << sb.sb_blocklog) == -1)
break;
@@ -2115,6 +2112,7 @@ an AG size that is one stripe unit small
BTOBB(WHACK_SIZE));
bzero(XFS_BUF_PTR(buf), WHACK_SIZE);
libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+ libxfs_purgebuf(buf);
}

/*