xfs
[Top] [All Lists]

Re: REVIEW: zero existing secondary superblocks with mkfs.xfs -f

To: Barry Naujok <bnaujok@xxxxxxx>
Subject: Re: REVIEW: zero existing secondary superblocks with mkfs.xfs -f
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 11 Jul 2007 21:35:46 -0500
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>, xfs-dev <xfs-dev@xxxxxxx>
In-reply-to: <op.tvbsh9z43jf8g2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <op.tvamambx3jf8g2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <46951C0A.4080505@xxxxxxxxxxx> <op.tvbsh9z43jf8g2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.4 (Macintosh/20070604)
Barry Naujok wrote:
> On Thu, 12 Jul 2007 04:06:02 +1000, Eric Sandeen <sandeen@xxxxxxxxxxx>  
> wrote:

>> +    if (sb.sb_magicnum != XFS_SB_MAGIC || sb.sb_blocksize == 0)
>> +            goto done;
>>
>> Is there any chance we'd be here if the first test weren't already true?
>>  *shrug* harmless though I guess.
> 
> It's quite easy to get there if you run mkfs.xfs -f on non-XFS
> filesystem.

Oh, duh.  Of course.

>> If something goes wrong and the old found SB is full of junk, this is
>> non-fatal, right.
> 
> Yep. Worst that will happen is the pwrite loop fails, and if so, it
> stops and exits. Maybe one subtle enhancement is to make sure the
> pwrite loop doesn't extend beyond the new filesystem size.
> 
>> Out of curiosity, why not just call verify_sb for the sanity checks
>> instead of recreating a subset of them in zero_old_xfs_structures?
> 
> Because that code is in xfs_repair and not mkfs. With mkfs.xfs, we
> don't really care if anything else in the SB is bad.

Maybe a libxfs candidate?  But, ok.  Just a thought.  :)

-Eric

> Barry.
> 


<Prev in Thread] Current Thread [Next in Thread>