From: Eric Sandeen <sandeen@sandeen.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: Ben England <bengland@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH V2] mkfs.xfs: go into multidisk mode when geometry is on cmdline
Date: Thu, 06 Dec 2012 15:35:33 -0600 [thread overview]
Message-ID: <50C10FA5.9090909@sandeen.net> (raw)
In-Reply-To: <20121121095636.GC23339@infradead.org>
In the course of some other investigations, I found that
calc_default_ag_geometry() doesn't go into "multidisk" mode
unless stripe geometry is *detected* (i.e. by the blkid routines).
Specifying a geometry on the cmdline is *not* sufficient, because
we test (ft.dsunit | ft.dswidth) which are not set by the cmdline
options.
If we move the AG calculations to after we have set dsunit & dswdith,
then we'll pick up either cmdline-specified or blkid-detected
geometry, and go into "multidisk" mode for AG size/count
calculations in both cases.
So now for a ~5T fs, for example, we'd make several more
AGs:
# truncate --size=5t fsfile
# mkfs.xfs -N -d su=128k,sw=8 fsfile | grep agcount
meta-data=fsfile isize=256 agcount=5, agsize=268435424 blks
# mkfs/mkfs.xfs -N -d su=128k,sw=8 fsfile | grep agcount
meta-data=fsfile isize=256 agcount=32, agsize=41943008 blks
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
V2: Add braces to last else clause per hch's request
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index be931e3..f320022 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2090,25 +2090,6 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
nbmblocks = 0;
}
- if (dasize) { /* User-specified AG size */
- /*
- * Check specified agsize is a multiple of blocksize.
- */
- if (agsize % blocksize) {
- fprintf(stderr,
- _("agsize (%lld) not a multiple of fs blk size (%d)\n"),
- (long long)agsize, blocksize);
- usage();
- }
- agsize /= blocksize;
- agcount = dblocks / agsize + (dblocks % agsize != 0);
-
- } else if (daflag) /* User-specified AG count */
- agsize = dblocks / agcount + (dblocks % agcount != 0);
- else
- calc_default_ag_geometry(blocklog, dblocks,
- ft.dsunit | ft.dswidth, &agsize, &agcount);
-
if (!nodsflag) {
if (dsunit) {
if (ft.dsunit && ft.dsunit != dsunit) {
@@ -2132,6 +2113,26 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
}
} /* else dsunit & dswidth can't be set if nodsflag is set */
+ if (dasize) { /* User-specified AG size */
+ /*
+ * Check specified agsize is a multiple of blocksize.
+ */
+ if (agsize % blocksize) {
+ fprintf(stderr,
+ _("agsize (%lld) not a multiple of fs blk size (%d)\n"),
+ (long long)agsize, blocksize);
+ usage();
+ }
+ agsize /= blocksize;
+ agcount = dblocks / agsize + (dblocks % agsize != 0);
+
+ } else if (daflag) { /* User-specified AG count */
+ agsize = dblocks / agcount + (dblocks % agcount != 0);
+ else {
+ calc_default_ag_geometry(blocklog, dblocks,
+ dsunit | dswidth, &agsize, &agcount);
+ }
+
/*
* If dsunit is a multiple of fs blocksize, then check that is a
* multiple of the agsize too
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-12-06 21:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 16:34 [PATCH, RFC] mkfs.xfs: go into multidisk mode when geometry is on cmdline Eric Sandeen
2012-11-21 9:56 ` Christoph Hellwig
2012-12-06 21:35 ` Eric Sandeen [this message]
2012-12-06 21:52 ` [PATCH V3] " Eric Sandeen
2012-12-08 11:59 ` Christoph Hellwig
2012-12-06 22:02 ` [PATCH] xfstests: Ensure cmdline geometry puts mkfs.xfs into multidisk mode Eric Sandeen
2012-12-08 12:00 ` Christoph Hellwig
2012-12-08 16:27 ` Eric Sandeen
2012-12-09 23:51 ` Dave Chinner
2012-12-10 0:23 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50C10FA5.9090909@sandeen.net \
--to=sandeen@sandeen.net \
--cc=bengland@redhat.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox