From: Christoph Lameter <clameter@sgi.com>
To: Mingming Cao <cmm@us.ibm.com>
Cc: Takashi Sato <sho@tnes.nec.co.jp>, linux-fsdevel@vger.kernel.org
Subject: [patch 1/4] Increase limits for 64k page size support for Ext2/3/4
Date: Tue, 25 Sep 2007 16:30:50 -0700 [thread overview]
Message-ID: <20070925233500.459345554@sgi.com> (raw)
In-Reply-To: 20070925233049.656803267@sgi.com
[-- Attachment #1: lbs_ext2-3-4 --]
[-- Type: text/plain, Size: 5035 bytes --]
[This patch allows architectures that use 64k blocksizes--like IA64 and
PPC64--to use 64k blocks on ext filesystems]
The patches to support blocksizes up to PAGESIZE, max 64KB for ext2/3/4,\
were originally from Takashi Sato.
http://marc.info/?l=linux-ext4&m=115768873518400&w=2
It's quite simple to support large block size in ext2/3/4, mostly just
enlarge the block size limit. But it is NOT possible to have 64kB
blocksize on ext2/3/4 without some changes to the directory handling
code. The reason is that an empty 64kB directory block would have a
rec_len == (__u16)2^16 == 0, and this would cause an error to be hit in
the filesystem. The proposed solution is to put 2 empty records in such
a directory, or to special-case an impossible value like rec_len =
0xffff to handle this.
Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
fs/ext2/super.c | 2 +-
fs/ext3/super.c | 5 ++++-
fs/ext4/super.c | 5 +++++
include/linux/ext2_fs.h | 4 ++--
include/linux/ext3_fs.h | 4 ++--
include/linux/ext4_fs.h | 4 ++--
6 files changed, 16 insertions(+), 8 deletions(-)
Index: linux-2.6.23-rc8-mm1/fs/ext2/super.c
===================================================================
--- linux-2.6.23-rc8-mm1.orig/fs/ext2/super.c 2007-09-25 14:53:57.000000000 -0700
+++ linux-2.6.23-rc8-mm1/fs/ext2/super.c 2007-09-25 15:37:34.000000000 -0700
@@ -856,7 +856,7 @@ static int ext2_fill_super(struct super_
brelse(bh);
if (!sb_set_blocksize(sb, blocksize)) {
- printk(KERN_ERR "EXT2-fs: blocksize too small for device.\n");
+ printk(KERN_ERR "EXT2-fs: bad blocksize %d.\n", blocksize);
goto failed_sbi;
}
Index: linux-2.6.23-rc8-mm1/fs/ext3/super.c
===================================================================
--- linux-2.6.23-rc8-mm1.orig/fs/ext3/super.c 2007-09-25 14:53:57.000000000 -0700
+++ linux-2.6.23-rc8-mm1/fs/ext3/super.c 2007-09-25 15:37:34.000000000 -0700
@@ -1625,7 +1625,10 @@ static int ext3_fill_super (struct super
}
brelse (bh);
- sb_set_blocksize(sb, blocksize);
+ if (!sb_set_blocksize(sb, blocksize)) {
+ printk(KERN_ERR "EXT3-fs: bad blocksize %d.\n", blocksize);
+ goto out_fail;
+ }
logic_sb_block = (sb_block * EXT3_MIN_BLOCK_SIZE) / blocksize;
offset = (sb_block * EXT3_MIN_BLOCK_SIZE) % blocksize;
bh = sb_bread(sb, logic_sb_block);
Index: linux-2.6.23-rc8-mm1/fs/ext4/super.c
===================================================================
--- linux-2.6.23-rc8-mm1.orig/fs/ext4/super.c 2007-09-25 14:53:57.000000000 -0700
+++ linux-2.6.23-rc8-mm1/fs/ext4/super.c 2007-09-25 15:37:34.000000000 -0700
@@ -1652,6 +1652,11 @@ static int ext4_fill_super (struct super
goto out_fail;
}
+ if (!sb_set_blocksize(sb, blocksize)) {
+ printk(KERN_ERR "EXT4-fs: bad blocksize %d.\n", blocksize);
+ goto out_fail;
+ }
+
/*
* The ext4 superblock will not be buffer aligned for other than 1kB
* block sizes. We need to calculate the offset from buffer start.
Index: linux-2.6.23-rc8-mm1/include/linux/ext2_fs.h
===================================================================
--- linux-2.6.23-rc8-mm1.orig/include/linux/ext2_fs.h 2007-09-25 14:53:58.000000000 -0700
+++ linux-2.6.23-rc8-mm1/include/linux/ext2_fs.h 2007-09-25 15:37:34.000000000 -0700
@@ -87,8 +87,8 @@ static inline struct ext2_sb_info *EXT2_
* Macro-instructions used to manage several block sizes
*/
#define EXT2_MIN_BLOCK_SIZE 1024
-#define EXT2_MAX_BLOCK_SIZE 4096
-#define EXT2_MIN_BLOCK_LOG_SIZE 10
+#define EXT2_MAX_BLOCK_SIZE 65536
+#define EXT2_MIN_BLOCK_LOG_SIZE 10
#ifdef __KERNEL__
# define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize)
#else
Index: linux-2.6.23-rc8-mm1/include/linux/ext3_fs.h
===================================================================
--- linux-2.6.23-rc8-mm1.orig/include/linux/ext3_fs.h 2007-09-24 17:33:10.000000000 -0700
+++ linux-2.6.23-rc8-mm1/include/linux/ext3_fs.h 2007-09-25 15:37:34.000000000 -0700
@@ -76,8 +76,8 @@
* Macro-instructions used to manage several block sizes
*/
#define EXT3_MIN_BLOCK_SIZE 1024
-#define EXT3_MAX_BLOCK_SIZE 4096
-#define EXT3_MIN_BLOCK_LOG_SIZE 10
+#define EXT3_MAX_BLOCK_SIZE 65536
+#define EXT3_MIN_BLOCK_LOG_SIZE 10
#ifdef __KERNEL__
# define EXT3_BLOCK_SIZE(s) ((s)->s_blocksize)
#else
Index: linux-2.6.23-rc8-mm1/include/linux/ext4_fs.h
===================================================================
--- linux-2.6.23-rc8-mm1.orig/include/linux/ext4_fs.h 2007-09-25 14:53:58.000000000 -0700
+++ linux-2.6.23-rc8-mm1/include/linux/ext4_fs.h 2007-09-25 15:37:34.000000000 -0700
@@ -77,8 +77,8 @@
* Macro-instructions used to manage several block sizes
*/
#define EXT4_MIN_BLOCK_SIZE 1024
-#define EXT4_MAX_BLOCK_SIZE 4096
-#define EXT4_MIN_BLOCK_LOG_SIZE 10
+#define EXT4_MAX_BLOCK_SIZE 65536
+#define EXT4_MIN_BLOCK_LOG_SIZE 10
#ifdef __KERNEL__
# define EXT4_BLOCK_SIZE(s) ((s)->s_blocksize)
#else
--
next prev parent reply other threads:[~2007-09-25 23:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-25 23:30 [patch 0/4] 64k pagesize/blocksize fixes Christoph Lameter
2007-09-25 23:30 ` Christoph Lameter [this message]
2007-09-25 23:30 ` [patch 2/4] ext2: fix rec_len overflow for 64KB block size Christoph Lameter
2007-09-26 0:42 ` Andreas Dilger
2007-09-26 17:27 ` Christoph Lameter
2007-09-25 23:30 ` [patch 3/4] ext3: fix rec_len overflow with " Christoph Lameter
2007-09-25 23:30 ` [patch 4/4] ext4: fix rec_len overflow for " Christoph Lameter
2007-09-26 17:58 ` [patch 0/4] 64k pagesize/blocksize fixes Mingming Cao
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=20070925233500.459345554@sgi.com \
--to=clameter@sgi.com \
--cc=cmm@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sho@tnes.nec.co.jp \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.