2006-05-25 12:49:12

by Takashi Sato

[permalink] [raw]
Subject: [UPDATE][12/24]ext3 enlarge blocksize

Summary of this patch:
[12/24] enlarge block size(ext3)
- Add an incompat flag "EXT3_FEATURE_INCOMPAT_LARGE_BLOCK"
which indicates that the filesystem is extended.

- Allow block size till pagesize in ext3.

Signed-off-by: Takashi Sato [email protected]
---
diff -upNr -X linux-2.6.17-rc4/Documentation/dontdiff linux-2.6.17-rc4/fs/ext3/super.c linux-2.6.17-rc4.tmp/fs/ext3/super.c
--- linux-2.6.17-rc4/fs/ext3/super.c 2006-05-25 16:33:29.710682647 +0900
+++ linux-2.6.17-rc4.tmp/fs/ext3/super.c 2006-05-25 16:33:52.245838621 +0900
@@ -1463,11 +1463,17 @@ static int ext3_fill_super (struct super
}
blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size);

+ if (blocksize > PAGE_SIZE) {
+ printk(KERN_ERR "EXT3-fs: cannot mount filesystem with "
+ "blocksize %u larger than PAGE_SIZE %u on %s\n",
+ blocksize, PAGE_SIZE, sb->s_id);
+ goto failed_mount;
+ }
+
if (blocksize < EXT3_MIN_BLOCK_SIZE ||
- blocksize > EXT3_MAX_BLOCK_SIZE) {
- printk(KERN_ERR
- "EXT3-fs: Unsupported filesystem blocksize %d on %s.\n",
- blocksize, sb->s_id);
+ blocksize > EXT3_EXTENDED_MAX_BLOCK_SIZE) {
+ printk(KERN_ERR "EXT3-fs: Unsupported filesystem blocksize %d on %s.\n",
+ blocksize, sb->s_id);
goto failed_mount;
}

diff -upNr -X linux-2.6.17-rc4/Documentation/dontdiff linux-2.6.17-rc4/include/linux/ext2_fs.h linux-2.6.17-rc4.tmp/include/linux/ext2_fs.h
--- linux-2.6.17-rc4/include/linux/ext2_fs.h 2006-03-20 14:53:29.000000000 +0900
+++ linux-2.6.17-rc4.tmp/include/linux/ext2_fs.h 2006-05-25 16:33:52.246815183 +0900
@@ -91,6 +91,7 @@ static inline struct ext2_sb_info *EXT2_
*/
#define EXT2_MIN_BLOCK_SIZE 1024
#define EXT2_MAX_BLOCK_SIZE 4096
+#define EXT2_EXTENDED_MAX_BLOCK_SIZE 65536
#define EXT2_MIN_BLOCK_LOG_SIZE 10
#ifdef __KERNEL__
# define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize)
@@ -471,11 +472,13 @@ struct ext2_super_block {
#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010
+#define EXT2_FEATURE_INCOMPAT_HUGE_FS 0x0080
#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff

#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \
- EXT2_FEATURE_INCOMPAT_META_BG)
+ EXT2_FEATURE_INCOMPAT_META_BG| \
+ EXT2_FEATURE_INCOMPAT_HUGE_FS)
#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \
EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \
EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
diff -upNr -X linux-2.6.17-rc4/Documentation/dontdiff linux-2.6.17-rc4/include/linux/ext3_fs.h linux-2.6.17-rc4.tmp/include/linux/ext3_fs.h
--- linux-2.6.17-rc4/include/linux/ext3_fs.h 2006-05-25 16:33:29.711659209 +0900
+++ linux-2.6.17-rc4.tmp/include/linux/ext3_fs.h 2006-05-25 16:33:52.247791746 +0900
@@ -86,6 +86,7 @@ struct statfs;
*/
#define EXT3_MIN_BLOCK_SIZE 1024
#define EXT3_MAX_BLOCK_SIZE 4096
+#define EXT3_EXTENDED_MAX_BLOCK_SIZE 65536
#define EXT3_MIN_BLOCK_LOG_SIZE 10
#ifdef __KERNEL__
# define EXT3_BLOCK_SIZE(s) ((s)->s_blocksize)
@@ -563,11 +564,13 @@ static inline struct ext3_inode_info *EX
#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */
#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */
#define EXT3_FEATURE_INCOMPAT_META_BG 0x0010
+#define EXT3_FEATURE_INCOMPAT_HUGE_FS 0x0080

#define EXT3_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
#define EXT3_FEATURE_INCOMPAT_SUPP (EXT3_FEATURE_INCOMPAT_FILETYPE| \
EXT3_FEATURE_INCOMPAT_RECOVER| \
- EXT3_FEATURE_INCOMPAT_META_BG)
+ EXT3_FEATURE_INCOMPAT_META_BG| \
+ EXT3_FEATURE_INCOMPAT_HUGE_FS)
#define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
EXT3_FEATURE_RO_COMPAT_BTREE_DIR)




2006-05-26 12:01:04

by Andreas Dilger

[permalink] [raw]
Subject: Re: [UPDATE][12/24]ext3 enlarge blocksize

At least part of this patch can be included into the patch series that
Mingming has posted to allow larger block sizes on architectures that
support it. This doesn't need a separate COMPAT flag itself, since
older kernels will already refuse to mount a filesystem with large blocks.

On May 25, 2006 21:49 +0900, [email protected] wrote:
> @@ -1463,11 +1463,17 @@ static int ext3_fill_super (struct super
> + if (blocksize > PAGE_SIZE) {
> + printk(KERN_ERR "EXT3-fs: cannot mount filesystem with "
> + "blocksize %u larger than PAGE_SIZE %u on %s\n",
> + blocksize, PAGE_SIZE, sb->s_id);
> + goto failed_mount;
> + }
> +
> if (blocksize < EXT3_MIN_BLOCK_SIZE ||
> - blocksize > EXT3_MAX_BLOCK_SIZE) {
> + blocksize > EXT3_EXTENDED_MAX_BLOCK_SIZE) {

We may as well just change EXT3_MAX_BLOCK_SIZE to be 65536, because no other
code uses this value. It is already 65536 in the e2fsprogs.

> - printk(KERN_ERR
> - "EXT3-fs: Unsupported filesystem blocksize %d on %s.\n",
> - blocksize, sb->s_id);
> + printk(KERN_ERR "EXT3-fs: Unsupported filesystem blocksize %d on %s.\n",
> + blocksize, sb->s_id);

I'm not sure why you changed the formatting of this message to now be longer
than 80 columns.

> diff -upNr -X linux-2.6.17-rc4/Documentation/dontdiff linux-2.6.17-rc4/include/linux/ext3_fs.h linux-2.6.17-rc4.tmp/include/linux/ext3_fs.h
> --- linux-2.6.17-rc4/include/linux/ext3_fs.h 2006-05-25 16:33:29.711659209 +0900
> +++ linux-2.6.17-rc4.tmp/include/linux/ext3_fs.h 2006-05-25 16:33:52.247791746 +0900
> @@ -86,6 +86,7 @@ struct statfs;
> */
> #define EXT3_MIN_BLOCK_SIZE 1024
> #define EXT3_MAX_BLOCK_SIZE 4096
> +#define EXT3_EXTENDED_MAX_BLOCK_SIZE 65536
> #define EXT3_MIN_BLOCK_LOG_SIZE 10
> #ifdef __KERNEL__
> # define EXT3_BLOCK_SIZE(s) ((s)->s_blocksize)

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

2006-05-30 12:24:42

by Takashi Sato

[permalink] [raw]
Subject: Re: [UPDATE][12/24]ext3 enlarge blocksize

Hi Andreas,

On May 26, 2006, Andreas wrote:
> At least part of this patch can be included into the patch series that
> Mingming has posted to allow larger block sizes on architectures that
> support it. This doesn't need a separate COMPAT flag itself, since
> older kernels will already refuse to mount a filesystem with
> large blocks.

Do you mention block size? I don't use the COMPAT flag for large block
size, but for >2G blocks.

> On May 25, 2006 21:49 +0900, [email protected] wrote:
> > @@ -1463,11 +1463,17 @@ static int ext3_fill_super (struct super
> > + if (blocksize > PAGE_SIZE) {
> > + printk(KERN_ERR "EXT3-fs: cannot mount filesystem with "
> > + "blocksize %u larger than PAGE_SIZE %u on %s\n",
> > + blocksize, PAGE_SIZE, sb->s_id);
> > + goto failed_mount;
> > + }
> > +
> > if (blocksize < EXT3_MIN_BLOCK_SIZE ||
> > - blocksize > EXT3_MAX_BLOCK_SIZE) {
> > + blocksize > EXT3_EXTENDED_MAX_BLOCK_SIZE) {
>
> We may as well just change EXT3_MAX_BLOCK_SIZE to be 65536,
> because no other
> code uses this value. It is already 65536 in the e2fsprogs.

Agree.

>
> > - printk(KERN_ERR
> > - "EXT3-fs: Unsupported filesystem
> blocksize %d on %s.\n",
> > - blocksize, sb->s_id);
> > + printk(KERN_ERR "EXT3-fs: Unsupported
> filesystem blocksize %d on %s.\n",
> > + blocksize, sb->s_id);
>
> I'm not sure why you changed the formatting of this message
> to now be longer
> than 80 columns.

Oops, you are right.

Thanks a lot, Andreas!


Cheers, sho


2006-05-30 19:12:42

by Andreas Dilger

[permalink] [raw]
Subject: Re: [UPDATE][12/24]ext3 enlarge blocksize

On May 30, 2006 21:24 +0900, [email protected] wrote:
> On May 26, 2006, Andreas wrote:
> > At least part of this patch can be included into the patch series that
> > Mingming has posted to allow larger block sizes on architectures that
> > support it. This doesn't need a separate COMPAT flag itself, since
> > older kernels will already refuse to mount a filesystem with
> > large blocks.
>
> Do you mention block size?

Yes, it just seemed confusing to be including these two items in the
same patch. I was trying to indicate that the 64k block support should
be submitted to Mingming as a standalone patch atop her patch series,
which is the one that will be submitted for kernel inclusion.

> I don't use the COMPAT flag for large block size, but for >2G blocks.

Agreed. However, there will be a different COMPAT flag for large
filesystems introduced as part of the other 48-bit ext3 changes.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

2006-06-01 02:52:07

by Takashi Sato

[permalink] [raw]
Subject: RE:[UPDATE][12/24]ext3 enlarge blocksize

Hi Andreas,

On May 31, 2006, Andreas wrote:
> On May 30, 2006 21:24 +0900, [email protected] wrote:
> > On May 26, 2006, Andreas wrote:
> > > At least part of this patch can be included into the patch series
> > > that Mingming has posted to allow larger block sizes on
> > > architectures that support it. This doesn't need a separate
> > > COMPAT flag itself, since older kernels will already refuse to
> > > ount a filesystem with large blocks.
> >
> > Do you mention block size?
>
> Yes, it just seemed confusing to be including these two items in the
> same patch. I was trying to indicate that the 64k block
> support should
> be submitted to Mingming as a standalone patch atop her patch series,
> which is the one that will be submitted for kernel inclusion.

Hmm... I see what you're trying to say, but I'm working on typedef and
I'll post my patches later.


Cheers, sho