E2fsprogs master branch now has all 64-bit patch applied
It's taken way too long, but I've finally finished integrating the 64-bit patches into e2fsprogs's mainline repository. All of the necessary patches should now be in the master branch for e2fsprogs.
The big change from before is that I replaced Val's changes for fixing up how mke2fs picked the correct fs-type profile from mke2fs.conf with something that I think works much better and leaves the code much cleaner. With this change you need to add the following to your /etc/mke2fs.conf file if you want to enable the 64-bit feature flag automatically for a big disk:
[fs_types]
ext4 = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
auto_64-bit_support = 1 # <---- add this line
inode_size = 256
}Alternatively you can change the features line to include the feature "64bit"; this will force the use of the 64-bit fields, and double the size of the block group descriptors, even for smaller file systems that don't require the 64-bit support. (This was one of my problems with Val's implementation; it forced the mke2fs.conf file to always enable the 64-bit feature flag, which would cause backwards compatibility issues.) This might be a good thing to do for debugging purposes, though, so this is an option which I left open, but the better way of doing things is to use the auto_64-bit-support flag.
Should the default for auto_64-bit-support be on or off? For now I've left it to be defaulted to "off", on the theory that it might be useful for distributions that aren't quite ready to enable 64-bit support until we do a lot more testing. But I may very well change this default before 1.42 ships, on the theory that people who want to disable this just ship an edited mke2fs.conf file. (Users can always explicit request 64bit support by using "mke2fs -O 64bit", of course.) Comments on this would be appreciated.
The other support which I've added into mke2fs.conf handling is I've added two additional automatically selected fs-types, which work like "floppy" and "small". These are "big" which is automatically selected for filesystems >= 4TB, and and "huge" which is elected for filesystems
Quoted 1 line
= 16TB. I'm not 100% sure this will be useful, but it seemed like
it might be useful to have these. Again, comments appreciated it; the names and the cutoff points may change before the 1.42 release.
What are things that are still left to be done before we 64-bit support is completely supported? Just a few things:
* Currently the badblocks list mechanism only supports 32-bit blocks. This may be OK, since running "badblocks" on a really large disk is probably a fool's errand. But how we handle this is an open question; should we just refuse "mke2fs -c" or "e2fsck -c" for really big file systems? Should we deprecate the badblocks inode altogether?
* The online resizing code, which relies on using a resize inode and indirect blocks, will not scale to 64-bit filesystems. We have the beginnings of support for the "meta_bg" style of resizing, which is supported by the kernel and the e2fsprogs code --- but it hasn't been implemented in the kernel yet. We need to add that.
As a related note, currently the online resizing code doesn't understand about flex_bg, so the filesystem layout for filesystems which are grown using online resizing is definitely not optimized for flex_bg. This is something that we would probably want to fix at the same time, since it means adding a new ioctl interface between the kernel and the resize2fs program.
- Ted
Theodore Ts'o wrote:
...
Quoted 9 lines
What are things that are still left to be done before we 64-bit support is completely supported? Just a few things:
* Currently the badblocks list mechanism only supports 32-bit blocks. This may be OK, since running "badblocks" on a really large disk is probably a fool's errand. But how we handle this is an open question; should we just refuse "mke2fs -c" or "e2fsck -c" for really big file systems? Should we deprecate the badblocks inode altogether?
Quoted 5 lines
* The online resizing code, which relies on using a resize inode and indirect blocks, will not scale to 64-bit filesystems. We have the beginnings of support for the "
meta_bg" style of resizing, which is supported by the kernel and the e2fsprogs code --- but it hasn't been implemented in the kernel yet. We need to add that.
* Lazy inode table initialization so that large fs mkfs time is acceptable.
-Eric
Quoted 47 lines · Theodore Ts'o
It's taken way too long, but I've finally finished integrating the 64-bit patches into e2fsprogs's mainline repository. All of the necessary patches should now be in the master branch for e2fsprogs.
The big change from before is that I replaced Val's changes for fixing up how mke2fs picked the correct fs-type profile from mke2fs.conf with something that I think works much better and leaves the code much cleaner. With this change you need to add the following to your
/etc/mke2fs.conffile if you want to enable the 64-bit feature flag automatically for a big disk:[
fs_types]ext4 = { features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize auto_64-bit_support = 1 #<---- add this line inode_size = 256 }Alternatively you can change the features line to include the feature "64bit"; this will force the use of the 64-bit fields, and double the size of the block group descriptors, even for smaller file systems that don't require the 64-bit support. (This was one of my problems with Val's implementation; it forced the mke2fs.conf file to always enable the 64-bit feature flag, which would cause backwards compatibility issues.) This might be a good thing to do for debugging purposes, though, so this is an option which I left open, but the better way of doing things is to use the auto_64-bit-support flag.
Should the default for auto_64-bit-support be on or off? For now I've left it to be defaulted to "off", on the theory that it might be useful for distributions that aren't quite ready to enable 64-bit support until we do a lot more testing. But I may very well change this default before 1.42 ships, on the theory that people who want to disable this just ship an edited mke2fs.conf file. (Users can always explicit request 64bit support by using "mke2fs -O 64bit", of course.) Comments on this would be appreciated.
The other support which I've added into mke2fs.conf handling is I've added two additional automatically selected fs-types, which work like "floppy" and "small". These are "big" which is automatically selected for filesystems>= 4TB, and and "huge" which is elected for filesystems
Quoted 2 lines
= 16TB. I'm not 100% sure this will be useful, but it seemed like
it might be useful to have these. Again, comments appreciated it; the names and the cutoff points may change before the 1.42 release.
Quoted 9 lines
What are things that are still left to be done before we 64-bit support is completely supported? Just a few things:
* Currently the badblocks list mechanism only supports 32-bit blocks. This may be OK, since running "badblocks" on a really large disk is probably a fool's errand. But how we handle this is an open question; should we just refuse "mke2fs -c" or "e2fsck -c" for really big file systems? Should we deprecate the badblocks inode altogether?
I think that badblocks is pretty much a legacy item at this point. Certainly not common on really large devices which are almost always RAID'ed in some form.
Thanks!
Ric
Quoted 15 lines
* The online resizing code, which relies on using a resize inode and indirect blocks, will not scale to 64-bit filesystems. We have the beginnings of support for the "
meta_bg" style of resizing, which is supported by the kernel and the e2fsprogs code --- but it hasn't been implemented in the kernel yet. We need to add that.As a related note, currently the online resizing code doesn't understand about
flex_bg, so the filesystem layout for filesystems which are grown using online resizing is definitely not optimized forflex_bg. This is something that we would probably want to fix at the same time, since it means adding a new ioctl interface between the kernel and the resize2fs program.- Ted
Quoted 3 lines · Theodore Ts'o
It's taken way too long, but I've finally finished integrating the 64-bit patches into e2fsprogs's mainline repository. All of the necessary patches should now be in the master branch for e2fsprogs.
FWIW, this:
commit cf828f1a72ec1eb0c1e819307137879447c909b7
Author: Theodore Ts'o <[email protected]> Date: Sun Oct 25 21:46:01 2009 -0400
libext2fs: Byte-swap 64-bit block group descriptors
is blowing up all over on ppc, with glibc-detected memory problems like:
Running e2fsprogs test suite...
d_loaddump: debugfs load/dump test: *** glibc detected *** ../debugfs/debugfs: free(): invalid next size (fast): 0x000001001bb03130 *** ======= Backtrace: =========
/lib64/libc.so.6[0x803da3f744]
../debugfs/debugfs[0x100213e4]
../debugfs/debugfs[0x100037c8]
../debugfs/debugfs[0x100040b4]
/lib64/libc.so.6[0x803d9dbc78] /lib64/libc.so.6(__libc_start_main-0x184e60)[0x803d9dbe70] ======= Memory map: ========
10000000-10040000 r-xp 00000000 fd:00 1443282
/root/e2fsprogs/debugfs/debugfs
10040000-10050000 rw-p 00040000 fd:00 1443282
/root/e2fsprogs/debugfs/debugfs
803d920000-803d950000 r-xp 00000000 fd:00 134600
/lib64/ld-2.12.so
803d950000-803d960000 r--p 00020000 fd:00 134600
/lib64/ld-2.12.so
803d960000-803d970000 rw-p 00030000 fd:00 134600
/lib64/ld-2.12.so
803d990000-803db50000 r-xp 00000000 fd:00 134601
/lib64/libc-2.12.so
803db50000-803db60000 r--p 001b0000 fd:00 134601
/lib64/libc-2.12.so
803db60000-803db70000 rw-p 001c0000 fd:00 134601
/lib64/libc-2.12.so
803db70000-803db80000 rw-p 00000000 00:00 0 803db80000-803db90000 r-xp 00000000 fd:00 134602
/lib64/libdl-2.12.so
803db90000-803dba0000 r--p 00000000 fd:00 134602
/lib64/libdl-2.12.so
803dba0000-803dbb0000 rw-p 00010000 fd:00 134602
/lib64/libdl-2.12.so
803dbb0000-803dbd0000 r-xp 00000000 fd:00 134613
/lib64/libpthread-2.12.so
803dbd0000-803dbe0000 r--p 00010000 fd:00 134613
/lib64/libpthread-2.12.so
803dbe0000-803dbf0000 rw-p 00020000 fd:00 134613
/lib64/libpthread-2.12.so
1001bb00000-1001bb30000 rw-p 00000000 00:00 0
[heap]
fffab260000-fffab280000 r-xp 00000000 00:00 0
[vdso]
ffffb920000-ffffba70000 rw-p 00000000 00:00 0
[stack]
./d_loaddump/script: line 22: 2743 Aborted (core
dumped) $DEBUGFS -R "write $TEST_DATA test_data" -w $TMPFILE >> $OUT.new 2>&1
Quoted 8 lines · Eric Sandeen
Quoted 3 lines · Theodore Ts'o
It's taken way too long, but I've finally finished integrating the 64-bit patches into e2fsprogs's mainline repository. All of the necessary patches should now be in the master branch for e2fsprogs.
FWIW, this:
commit
cf828f1a72ec1eb0c1e819307137879447c909b7
Quoted 8 lines
Author: Theodore Ts'o <[email protected]> Date: Sun Oct 25 21:46:01 2009 -0400libext2fs: Byte-swap 64-bit block group descriptors
Signed-off-by "Theodore Ts'o" <[email protected]>is blowing up all over on ppc, with glibc-detected memory problems like:
I took a quick look at this patch and saw one obvious thing:
lib/ext2fs/openfs.c +6 -4
@@ -322,7 +322,7 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,#ifdef WORDS_BIGENDIAN gdp = (struct ext2_group_desc *) dest;for (j=0 ; j < groups_per_block*first_meta_bg; j++) -ext2fs_swap_group_desc (gdp++); +ext2fs_swap_group_desc2 (fs, gdp++);#endif dest += fs->blocksize*first_meta_bg; }
@@ -332,9 +332,11 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,if (retval) goto cleanup;#ifdef WORDS_BIGENDIAN - gdp = (struct ext2_group_desc *) dest; -for (j=0 ; j < groups_per_block; j++) -ext2fs_swap_group_desc (gdp++); +for (j=0 ; j < groups_per_block; j++) { +/* The below happens to work... be careful. */ + gdp =ext2fs_group_desc (fs, blk, j); +ext2fs_swap_group_desc2 (fs, gdp); + }#endif dest += fs->blocksize; }
I think the first hunk should use the same code as the second hunk - the first bit is always incrementing by the size of struct ext2_group_desc, when it needs to increment by the size of struct ext4_group_desc on 64-bit file systems. ext2fs_group_desc() does the right thing.
Also, there's a teensy bit of whitespace damage in the second hunk in csum.c.
Looks like there's a lot of low-hanging fruit just compiling for big-endian.
-VAL