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 13:06:02 -0500
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>, xfs-dev <xfs-dev@xxxxxxx>
In-reply-to: <op.tvamambx3jf8g2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <op.tvamambx3jf8g2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 1.5.0.12 (X11/20070530)
Barry Naujok wrote:
> The attached patch zeros all the secondary superblocks if
> overwriting an existing XFS filesystem.
> 
> This allows xfs_repair to detect the correct secondary block
> if the primary is destroyed (like XFS QA test 030).

Seems good to me (after filtering out all of the quilt-induced
whitespace changes ;-) )

+       /*
+        * perform same basic superblock validation to make sure we
+        * actually zero secondary blocks
+        */
+       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.

If something goes wrong and the old found SB is full of junk, this is
non-fatal, right.

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?

Thanks,

-Eric


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