tags 500593 patch thanks I fixed this by re-adding the imflag ? imaxpct : defaut logic. I also re-arranged the -N printing logic to use the values stored in sbp, instead of duplicating code when it's easy to avoid. see attached patch. I'm not sure you'll like it, since only some of the printed values are re-extracted from sbp. I left ones that weren't trivial as they are.
I also moved the code that sets dsunit and dswidth from xlv_dsunit and xlv_dswidth to before the call to calc_default_ag_geometry(), so multidisk will be true when the user specifies RAID parameters, not just when they're read from LVM (xlv_ds...). Is this sensible, or is agcount=4 appropriate for an 8 disk RAID6 on a quad-core machine? I was thinking agcount=8 might be better, but that agcount=32 might still be too many. I'm not expecting a huge amount of extremely small files, and I am planning to mount with inode64... BTW, while checking this out I found and reported http://oss.sgi.com/bugzilla/show_bug.cgi?id=793 -- #define X(x,y) x##y Peter Cordes ; e-mail: X([EMAIL PROTECTED] , des.ca) "The gods confound the man who first found out how to distinguish the hours! Confound him, too, who in this place set up a sundial, to cut and hack my day so wretchedly into small pieces!" -- Plautus, 200 BC
diff -ur xfsprogs-2.9.8/mkfs/xfs_mkfs.c xfsprogs-2.9.8.pjc/mkfs/xfs_mkfs.c --- xfsprogs-2.9.8/mkfs/xfs_mkfs.c 2008-04-21 03:56:48.000000000 -0300 +++ xfsprogs-2.9.8.pjc/mkfs/xfs_mkfs.c 2008-09-29 16:24:02.987448694 -0300 @@ -1609,6 +1609,29 @@ calc_stripe_factors(dsu, dsw, sectorsize, lsu, lsectorsize, &dsunit, &dswidth, &lsunit); + if (!nodsflag) { + if (dsunit) { + if (xlv_dsunit && xlv_dsunit != dsunit) { + fprintf(stderr, + _("%s: Specified data stripe unit %d " + "is not the same as the volume stripe " + "unit %d\n"), + progname, dsunit, xlv_dsunit); + } + if (xlv_dswidth && xlv_dswidth != dswidth) { + fprintf(stderr, + _("%s: Specified data stripe width %d " + "is not the same as the volume stripe " + "width %d\n"), + progname, dswidth, xlv_dswidth); + } + } else { + dsunit = xlv_dsunit; + dswidth = xlv_dswidth; + nodsflag = 1; + } + } /* else dsunit & dswidth can't be set if nodsflag is set */ + if (slflag || ssflag) xi.setblksize = sectorsize; else @@ -1800,7 +1823,7 @@ agsize = dblocks / agcount + (dblocks % agcount != 0); else calc_default_ag_geometry(blocklog, dblocks, - xlv_dsunit | xlv_dswidth, &agsize, &agcount); + dsunit | dswidth, &agsize, &agcount); /* * If the last AG is too small, reduce the filesystem size @@ -1815,29 +1838,6 @@ validate_ag_geometry(blocklog, dblocks, agsize, agcount); - if (!nodsflag) { - if (dsunit) { - if (xlv_dsunit && xlv_dsunit != dsunit) { - fprintf(stderr, - _("%s: Specified data stripe unit %d " - "is not the same as the volume stripe " - "unit %d\n"), - progname, dsunit, xlv_dsunit); - } - if (xlv_dswidth && xlv_dswidth != dswidth) { - fprintf(stderr, - _("%s: Specified data stripe width %d " - "is not the same as the volume stripe " - "width %d\n"), - progname, dswidth, xlv_dswidth); - } - } else { - dsunit = xlv_dsunit; - dswidth = xlv_dswidth; - nodsflag = 1; - } - } /* else dsunit & dswidth can't be set if nodsflag is set */ - /* * If dsunit is a multiple of fs blocksize, then check that is a * multiple of the agsize too @@ -2018,30 +2018,6 @@ } validate_log_size(logblocks, blocklog, min_logblocks); - if (!qflag || Nflag) { - printf(_( - "meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" - " =%-22s sectsz=%-5u attr=%u\n" - "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" - " =%-22s sunit=%-6u swidth=%u blks\n" - "naming =version %-14u bsize=%-6u\n" - "log =%-22s bsize=%-6d blocks=%lld, version=%d\n" - " =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n" - "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n"), - dfile, isize, (long long)agcount, (long long)agsize, - "", sectorsize, attrversion, - "", blocksize, (long long)dblocks, - calc_default_imaxpct(blocklog, dblocks), - "", dsunit, dswidth, - dirversion, dirversion == 1 ? blocksize : dirblocksize, - logfile, 1 << blocklog, (long long)logblocks, - logversion, "", lsectorsize, lsunit, lazy_sb_counters, - rtfile, rtextblocks << blocklog, - (long long)rtblocks, (long long)rtextents); - if (Nflag) - exit(0); - } - if (label) strncpy(sbp->sb_fname, label, sizeof(sbp->sb_fname)); sbp->sb_magicnum = XFS_SB_MAGIC; @@ -2068,7 +2044,7 @@ (__uint8_t)(rtextents ? libxfs_highbit32((unsigned int)rtextents) : 0); sbp->sb_inprogress = 1; /* mkfs is in progress */ - sbp->sb_imax_pct = calc_default_imaxpct(blocklog, dblocks); + sbp->sb_imax_pct = imflag ? imaxpct : calc_default_imaxpct(blocklog, dblocks); sbp->sb_icount = 0; sbp->sb_ifree = 0; sbp->sb_fdblocks = dblocks - agcount * XFS_PREALLOC_BLOCKS(mp) - @@ -2081,8 +2057,7 @@ if (dirversion == 2) sbp->sb_dirblklog = dirblocklog - blocklog; if (logversion == 2) { /* This is stored in bytes */ - lsunit = (lsunit == 0) ? 1 : XFS_FSB_TO_B(mp, lsunit); - sbp->sb_logsunit = lsunit; + sbp->sb_logsunit = (lsunit == 0) ? 1 : XFS_FSB_TO_B(mp, lsunit); } else sbp->sb_logsunit = 0; if (iaflag) { @@ -2103,6 +2078,33 @@ dirversion == 2, logversion == 2, attrversion == 1, (sectorsize != BBSIZE || lsectorsize != BBSIZE), sbp->sb_features2 != 0); + + + if (!qflag || Nflag) { + printf(_( + "meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" + " =%-22s sectsz=%-5u attr=%u\n" + "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" + " =%-22s sunit=%-6u swidth=%u blks\n" + "naming =version %-14u bsize=%-6u\n" + "log =%-22s bsize=%-6d blocks=%lld, version=%d\n" + " =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n" + "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n"), + dfile, (int)sbp->sb_inodesize, (long long)sbp->sb_agcount, (long long)sbp->sb_agblocks, + "", (unsigned int)sbp->sb_sectsize, attrversion, + "", sbp->sb_blocksize, (long long)dblocks, sbp->sb_imax_pct, + "", sbp->sb_unit, sbp->sb_width, + dirversion, dirversion == 1 ? blocksize : dirblocksize, + logfile, 1 << blocklog, (long long)sbp->sb_logblocks, logversion, + "", lsectorsize, lsunit, lazy_sb_counters, + rtfile, sbp->sb_rextsize << blocklog, + (long long)sbp->sb_rblocks, (long long)sbp->sb_rextents); + if (Nflag) + exit(0); + } + + + /* * Due to a structure alignment issue, sb_features2 ended up in one * of two locations, the second "incorrect" location represented by @@ -2163,7 +2165,7 @@ if (xi.logdev) libxfs_log_clear(xi.logdev, XFS_FSB_TO_DADDR(mp, logstart), (xfs_extlen_t)XFS_FSB_TO_BB(mp, logblocks), - &sbp->sb_uuid, logversion, lsunit, XLOG_FMT); + &sbp->sb_uuid, logversion, sbp->sb_logsunit, XLOG_FMT); mp = libxfs_mount(mp, sbp, xi.ddev, xi.logdev, xi.rtdev, 1); if (mp == NULL) {