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.
>
|