]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix up mkfs checking of logsize multiple of stripe size.
authorptools <ptools>
Fri, 20 Feb 2004 05:47:04 +0000 (05:47 +0000)
committerptools <ptools>
Fri, 20 Feb 2004 05:47:04 +0000 (05:47 +0000)
bump version for mkfs logsize check fix

VERSION
doc/CHANGES
mkfs/xfs_mkfs.c

diff --git a/VERSION b/VERSION
index 081669536be9187b19daa5b199c94e6e2f866ea3..4a5cc9d8c227bca454992b6755e5e016f6183b07 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=2
 PKG_MINOR=6
-PKG_REVISION=4
+PKG_REVISION=5
 PKG_BUILD=1
index 94163468af24a96a7c297245559d17f38d21b299..33b08b26e12c0870a7a0dae72a4b39fc67af0302 100644 (file)
@@ -1,3 +1,8 @@
+xfsprogs-2.6.5 (20 February 2003)
+       - Fix up mkfs to ensure that the log size is a multiple of
+         the v2 log stripe size even if the log happens to be aligned
+         on a log stripe boundary (always check it).
+
 xfsprogs-2.6.4 (17 February 2003)
        - Fix a few more libxfs/repair leaks.
        - Fix up some libhandle routines, add the open_by_fshandle
index 01e8ba8dafb1f4725ae84da175c86dc7953e7b64..4f9f13ba48258f783f5ae1695cbfba60e795c288 100644 (file)
@@ -299,11 +299,16 @@ fixup_log_stripe(
        __uint64_t      agsize,
        int             sunit,
        xfs_drfsbno_t   *logblocks,
-       int             blocklog)
+       int             blocklog,
+       int             *lalign)
 {
        __uint64_t      tmp_logblocks;
 
-       logstart = ((logstart + (sunit - 1))/sunit) * sunit;
+       if ((logstart % sunit) != 0) {
+               logstart = ((logstart + (sunit - 1))/sunit) * sunit;
+               *lalign = 1;
+       }
+
        /* 
         * Make sure that the log size is a multiple of the
         * stripe unit
@@ -1831,15 +1836,14 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
                /*
                 * Align the logstart at stripe unit boundary.
                 */
-               if (lsunit && ((logstart % lsunit) != 0)) {
+               if (lsunit) {
                        logstart = fixup_log_stripe(mp, lsflag, logstart,
-                                       agsize, lsunit, &logblocks, blocklog);
-                       lalign = 1;
-               } else if (dsunit && ((logstart % dsunit) != 0)) {
+                                       agsize, lsunit, &logblocks, blocklog,
+                                       &lalign);
+               } else if (dsunit) {
                        logstart = fixup_log_stripe(mp, lsflag, logstart,
-                                       agsize, dsunit, &logblocks,
-                                       blocklog);
-                       lalign = 1;
+                                       agsize, dsunit, &logblocks, blocklog,
+                                       &lalign);
                }
        } else
                logstart = 0;
@@ -2082,6 +2086,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
                        if (lalign) {
                                /*
                                 * Have to insert two records
+                                * Insert pad record for stripe align of log
                                 */
                                INT_SET(arec->ar_blockcount, ARCH_CONVERT, 
                                        (xfs_extlen_t)(XFS_FSB_TO_AGBNO(
@@ -2089,6 +2094,9 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
                                        - (INT_GET(arec->ar_startblock,
                                                ARCH_CONVERT))));
                                nrec = arec + 1;
+                               /*
+                                * Insert record at start of internal log
+                                */
                                INT_SET(nrec->ar_startblock, ARCH_CONVERT,
                                        INT_GET(arec->ar_startblock,
                                                ARCH_CONVERT) +
@@ -2097,6 +2105,9 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
                                arec = nrec;
                                INT_MOD(block->bb_numrecs, ARCH_CONVERT, 1);
                        } 
+                       /*
+                        * Change record start to after the internal log
+                        */
                        INT_MOD(arec->ar_startblock, ARCH_CONVERT, logblocks);
                } 
                INT_SET(arec->ar_blockcount, ARCH_CONVERT,