From: Steve Lord Date: Sat, 22 Jun 2002 03:16:25 +0000 (+0000) Subject: fix log stripe alignment code in the case where there is a data stripe X-Git-Tag: v2.2.0~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08b9217ab7859613c5e19db9960ab120cbb052a6;p=thirdparty%2Fxfsprogs-dev.git fix log stripe alignment code in the case where there is a data stripe but no log stripe specified. --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index c79469c9a..d1923e04e 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -356,7 +356,6 @@ fixup_log_stripe( { __uint64_t tmp_logblocks; - sunit = XFS_B_TO_FSB(mp, sunit); logstart = ((logstart + (sunit - 1))/sunit) * sunit; /* * Make sure that the log size is a multiple of the @@ -1647,9 +1646,9 @@ main(int argc, char **argv) lsunit, blocksize); exit(1); } - } else { - if (dsunit) - lsunit = dsunit; + } else if (dsunit) { + /* lsunit is in bytes here, dsunit is fs blocks */ + lsunit = dsunit << blocklog; } if (lsunit > 256 * 1024) { @@ -1696,15 +1695,15 @@ main(int argc, char **argv) * Align the logstart at stripe unit boundary. */ - if (lsunit && ((logstart % lsunit) != 0)) { + if (lsunit && ((logstart % XFS_B_TO_FSB(mp, lsunit)) != 0)) { logstart = fixup_log_stripe(mp, lsflag, logstart, - agsize, lsunit, &logblocks, - blocklog); + agsize, XFS_B_TO_FSB(mp, lsunit), + &logblocks, blocklog); lalign = 1; } else if (dsunit && ((logstart % dsunit) != 0)) { logstart = fixup_log_stripe(mp, lsflag, logstart, - agsize, dsunit, &logblocks, - blocklog); + agsize, dsunit, &logblocks, + blocklog); lalign = 1; } } else