From: David Chinner <dgc@sgi.com>
To: xfs-dev <xfs-dev@sgi.com>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: [RFC, patch 1/2] Allow up to 1GB logs in mkfs.xfs
Date: Fri, 22 Feb 2008 10:08:34 +1100 [thread overview]
Message-ID: <20080221230833.GG155407@sgi.com> (raw)
Increase the maximum log size supported by mkfs.
The log size can be increased easily in mkfs by changing a few
defines and a couple of types to allow the log size to increase to
1GB. Theoretically, the log size can be made much, much larger than
this (up to 2^32 sectors), but going beyond 2^30 *bytes* causes
integer overflow issues in the kernel log code.
e.g. a 2GB log (2^31 bytes) will not mount because the
space calculations in the kernel use "int" types and
overflow:
STATIC int
xlog_space_left(xlog_t *log, int cycle, int bytes)
Hence logs larger than 2^30 will not work without kernel
modifications. Therefore this change is limited to increasing the
log size to what we can currently support in kernel space with
needing kernel modifications.
Signed-off-by: Dave Chinner <dgc@sgi.com>
---
xfsprogs/include/xfs_fs.h | 8 ++++----
xfsprogs/mkfs/xfs_mkfs.c | 14 +++++++-------
2 files changed, 11 insertions(+), 11 deletions(-)
Index: xfs-cmds/xfsprogs/include/xfs_fs.h
===================================================================
--- xfs-cmds.orig/xfsprogs/include/xfs_fs.h 2008-02-19 11:38:24.333887808 +1100
+++ xfs-cmds/xfsprogs/include/xfs_fs.h 2008-02-19 18:16:21.701796360 +1100
@@ -248,10 +248,10 @@ typedef struct xfs_fsop_resblks {
* Minimum and maximum sizes need for growth checks
*/
#define XFS_MIN_AG_BLOCKS 64
-#define XFS_MIN_LOG_BLOCKS 512
-#define XFS_MAX_LOG_BLOCKS (64 * 1024)
-#define XFS_MIN_LOG_BYTES (256 * 1024)
-#define XFS_MAX_LOG_BYTES (128 * 1024 * 1024)
+#define XFS_MIN_LOG_BLOCKS 512ULL
+#define XFS_MAX_LOG_BLOCKS (1024 * 1024ULL)
+#define XFS_MIN_LOG_BYTES (10 * 1024 * 1024ULL)
+#define XFS_MAX_LOG_BYTES (1 * 1024 * 1024 * 1024ULL)
/*
* Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT
Index: xfs-cmds/xfsprogs/mkfs/xfs_mkfs.c
===================================================================
--- xfs-cmds.orig/xfsprogs/mkfs/xfs_mkfs.c 2008-02-07 20:14:08.000000000 +1100
+++ xfs-cmds/xfsprogs/mkfs/xfs_mkfs.c 2008-02-22 09:56:14.307824979 +1100
@@ -362,13 +362,13 @@ validate_log_size(__uint64_t logblocks,
}
if (logblocks > XFS_MAX_LOG_BLOCKS) {
fprintf(stderr,
- _("log size %lld blocks too large, maximum size is %d blocks\n"),
+ _("log size %lld blocks too large, maximum size is %lld blocks\n"),
(long long)logblocks, XFS_MAX_LOG_BLOCKS);
usage();
}
if ((logblocks << blocklog) > XFS_MAX_LOG_BYTES) {
fprintf(stderr,
- _("log size %lld bytes too large, maximum size is %d bytes\n"),
+ _("log size %lld bytes too large, maximum size is %lld bytes\n"),
(long long)(logblocks << blocklog), XFS_MAX_LOG_BYTES);
usage();
}
@@ -1728,7 +1728,7 @@ reported by the device (%u).\n"),
min_logblocks = max_tr_res * XFS_MIN_LOG_FACTOR;
min_logblocks = MAX(XFS_MIN_LOG_BLOCKS, min_logblocks);
if (!logsize && dblocks >= (1024*1024*1024) >> blocklog)
- min_logblocks = MAX(min_logblocks, (10*1024*1024)>>blocklog);
+ min_logblocks = MAX(min_logblocks, XFS_MIN_LOG_BYTES>>blocklog);
if (logsize && xi.logBBsize > 0 && logblocks > DTOBT(xi.logBBsize)) {
fprintf(stderr,
_("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
@@ -1748,10 +1748,10 @@ _("size %s specified for log subvolume i
logblocks = 0;
} else if (loginternal && !logsize) {
/*
- * logblocks grows from min_logblocks to XFS_MAX_LOG_BLOCKS
- * at 128GB
- *
- * 2048 = 128GB / MAX_LOG_BYTES
+ * With a 1GB max log size, default to maximum size
+ * at 2TB. This keeps the same ratio from the older
+ * max log size of 128M at 256GB fs size. IOWs,
+ * the ratio of fs size to log size is 2048:1.
*/
logblocks = (dblocks << blocklog) / 2048;
logblocks = logblocks >> blocklog;
next reply other threads:[~2008-02-21 23:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 23:08 David Chinner [this message]
2008-02-22 2:44 ` [RFC, patch 1/2] Allow up to 1GB logs in mkfs.xfs Niv Sardi
2008-02-22 5:03 ` David Chinner
2008-02-22 5:44 ` Lachlan McIlroy
2008-02-22 6:53 ` David Chinner
2008-02-25 1:10 ` Mark Goodwin
2008-02-25 1:31 ` Lachlan McIlroy
2008-02-28 18:17 ` David Chinner
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=20080221230833.GG155407@sgi.com \
--to=dgc@sgi.com \
--cc=xfs-dev@sgi.com \
--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