diff mbox

E2fsprogs master branch now has all 64-bit patch applied

Message ID 20100614202655.GB14808@shell
State Superseded, archived
Headers show

Commit Message

Valerie Aurora Henson June 14, 2010, 8:26 p.m. UTC
On Mon, Jun 14, 2010 at 03:15:40PM -0500, Eric Sandeen wrote:
> On 06/14/2010 08:39 AM, Theodore Ts'o wrote:
> > 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 <tytso@mit.edu>
> Date:   Sun Oct 25 21:46:01 2009 -0400
>     libext2fs: Byte-swap 64-bit block group descriptors
>     Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> 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:

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

Looks like there's a lot of low-hanging fruit just compiling for

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox


diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 52f56c0..7b325a1 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -322,7 +322,7 @@  errcode_t ext2fs_open2(const char *name, const char *io_options,
                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++);
                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;
-               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);
+               }
                dest += fs->blocksize;