]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix wiping old AG headers and purge whack buffers
authorBarry Naujok <bnaujok@sgi.com>
Tue, 25 Sep 2007 06:15:37 +0000 (06:15 +0000)
committerBarry Naujok <bnaujok@sgi.com>
Tue, 25 Sep 2007 06:15:37 +0000 (06:15 +0000)
Merge of master-melb:xfs-cmds:29767a by kenmcd.

  Fix wiping old AG headers and purge whack buffers

mkfs/xfs_mkfs.c

index ec326064173b67829c3334865afc2f741953c2fd..6e84a4e365b600185446105e5255658d5922ab04 100644 (file)
@@ -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 smaller, for example %llu.\n"),
                                    BTOBB(WHACK_SIZE));
                bzero(XFS_BUF_PTR(buf), WHACK_SIZE);
                libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+               libxfs_purgebuf(buf);
        }
 
        /*