Add stable boundary to the series file
[ext4-patch-queue.git] / ext2_large_blocksize_support.patch
blob5ec757cf26a283a390d6c9902cd6fc5da0adb1bf
1 Support large blocksize up to PAGESIZE (max 64KB) for ext2
3 From: Takashi Sato <sho@tnes.nec.co.jp>
5 This patch set supports large block size(>4k, <=64k) in ext2,
6 just enlarging the block size limit. But it is NOT possible to have 64kB
7 blocksize on ext2 without some changes to the directory handling
8 code. The reason is that an empty 64kB directory block would have a
9 rec_len == (__u16)2^16 == 0, and this would cause an error to be hit in
10 the filesystem. The proposed solution is treat 64k rec_len
11 with a an impossible value like rec_len = 0xffff to handle this.
13 The Patch-set consists of the following 2 patches.
14 [1/2] ext2: enlarge blocksize
15 - Allow blocksize up to pagesize
17 [2/2] ext2: fix rec_len overflow
18 - prevent rec_len from overflow with 64KB blocksize
20 Now on 64k page ppc64 box runs with this patch set we could create a 64k
21 block size ext2, and able to handle empty directory block.
23 Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
24 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
25 ---
27 fs/ext2/super.c | 3 ++-
28 include/linux/ext2_fs.h | 4 ++--
29 2 files changed, 4 insertions(+), 3 deletions(-)
32 Index: linux-2.6.23-rc9/fs/ext2/super.c
33 ===================================================================
34 --- linux-2.6.23-rc9.orig/fs/ext2/super.c 2007-10-05 10:12:36.000000000 -0700
35 +++ linux-2.6.23-rc9/fs/ext2/super.c 2007-10-05 10:13:38.000000000 -0700
36 @@ -775,7 +775,8 @@ static int ext2_fill_super(struct super_
37 brelse(bh);
39 if (!sb_set_blocksize(sb, blocksize)) {
40 - printk(KERN_ERR "EXT2-fs: blocksize too small for device.\n");
41 + printk(KERN_ERR "EXT2-fs: bad blocksize %d.\n",
42 + blocksize);
43 goto failed_sbi;
46 Index: linux-2.6.23-rc9/include/linux/ext2_fs.h
47 ===================================================================
48 --- linux-2.6.23-rc9.orig/include/linux/ext2_fs.h 2007-10-05 10:12:36.000000000 -0700
49 +++ linux-2.6.23-rc9/include/linux/ext2_fs.h 2007-10-05 10:13:38.000000000 -0700
50 @@ -86,8 +86,8 @@ static inline struct ext2_sb_info *EXT2_
51 * Macro-instructions used to manage several block sizes
53 #define EXT2_MIN_BLOCK_SIZE 1024
54 -#define EXT2_MAX_BLOCK_SIZE 4096
55 -#define EXT2_MIN_BLOCK_LOG_SIZE 10
56 +#define EXT2_MAX_BLOCK_SIZE 65536
57 +#define EXT2_MIN_BLOCK_LOG_SIZE 10
58 #ifdef __KERNEL__
59 # define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize)
60 #else