From: ptools Date: Fri, 20 Feb 2004 05:47:04 +0000 (+0000) Subject: Fix up mkfs checking of logsize multiple of stripe size. X-Git-Tag: v2.7.0~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=575fec4cabba9740141cf30458058677471798fc;p=thirdparty%2Fxfsprogs-dev.git Fix up mkfs checking of logsize multiple of stripe size. bump version for mkfs logsize check fix --- diff --git a/VERSION b/VERSION index 081669536..4a5cc9d8c 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=6 -PKG_REVISION=4 +PKG_REVISION=5 PKG_BUILD=1 diff --git a/doc/CHANGES b/doc/CHANGES index 94163468a..33b08b26e 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -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 diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 01e8ba8da..4f9f13ba4 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -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,