]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
zero more at end of device at mkfs time, be sure to
authorEric Sandeen <sandeen@sgi.com>
Mon, 3 May 2004 22:35:41 +0000 (22:35 +0000)
committerEric Sandeen <sandeen@sgi.com>
Mon, 3 May 2004 22:35:41 +0000 (22:35 +0000)
get any old md superblock (which throws off mount-by-label)
bump version

VERSION
doc/CHANGES
mkfs/xfs_mkfs.c

diff --git a/VERSION b/VERSION
index 80f3574507800920087da9043ba5b5480db24aef..92b207540add5c398f3add5353ad459368c2d950 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=2
 PKG_MINOR=6
-PKG_REVISION=12
+PKG_REVISION=13
 PKG_BUILD=1
index ca91e93dbc64d35fc2acbd7a6c55b9e0c0b5823c..72383c687c9941d879082f49f3eb84bbf2faa145 100644 (file)
@@ -1,3 +1,7 @@
+xfsprogs-2.6.13 (03 May 2004)
+       - zero out more at beginning and end of device at mkfs time
+         (get all old MD superblocks at the end, for mount by label).
+
 xfsprogs-2.6.12 (30 April 2004)
        - Extract stripe unit/width from device mapper devices
          (added libdisk infrastructure, used by mkfs.xfs).
index 61c1f65bc5a107fb08d5eb9808003cb42de16249..10ca6ebcf1935a32a0ea2ea1fdedaca27c033d58 100644 (file)
@@ -185,6 +185,11 @@ char       *sopts[] = {
        ((uint)(MKFS_BLOCKRES_INODE + XFS_DA_NODE_MAXDEPTH + \
        (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1) + (rb)))
 
+/* amount (in bytes) we zero at the beginning and end of the device to
+ * remove traces of other filesystems, raid superblocks, etc.
+ */
+#define WHACK_SIZE (128 * 1024)
+
 static void
 calc_stripe_factors(
        int             dsu,
@@ -1934,13 +1939,13 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
                        (sectorsize != BBSIZE || lsectorsize != BBSIZE), 0);
        sbp->sb_features2 = XFS_SB_VERSION2_MKFS(0);
        /*
-        * Zero out the first 68k in on the device, to obliterate any old 
+        * Zero out the beginning of the device, to obliterate any old 
         * filesystem signatures out there.  This should take care of 
         * swap (somewhere around the page size), jfs (32k), 
         * ext[2,3] and reiserfs (64k) - and hopefully all else.
         */
-       buf = libxfs_getbuf(xi.ddev, 0, 136);
-       bzero(XFS_BUF_PTR(buf), 136*BBSIZE);
+       buf = libxfs_getbuf(xi.ddev, 0, BTOBB(WHACK_SIZE));
+       bzero(XFS_BUF_PTR(buf), WHACK_SIZE);
        libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
 
        /* OK, now write the superblock */
@@ -1962,13 +1967,14 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
        }
 
        /*
-        * Zero out the last 64k on the device, to obliterate any
+        * Zero out the end of the device, to obliterate any
         * old MD RAID (or other) metadata at the end of the device.
+        * (MD sb is ~64k from the end, take out a wider swath to be sure)
         */
        if (!xi.disfile) {
-               buf = libxfs_getbuf(xi.ddev, (xi.dsize - BTOBB(65536)), 
-                                   BTOBB(65536));
-               bzero(XFS_BUF_PTR(buf), 65536);
+               buf = libxfs_getbuf(xi.ddev, (xi.dsize - BTOBB(WHACK_SIZE)), 
+                                   BTOBB(WHACK_SIZE));
+               bzero(XFS_BUF_PTR(buf), WHACK_SIZE);
                libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
        }