linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valerie Aurora <vaurora@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>, linux-ext4@vger.kernel.org
Subject: Re: E2fsprogs master branch now has all 64-bit patch applied
Date: Mon, 14 Jun 2010 16:26:55 -0400	[thread overview]
Message-ID: <20100614202655.GB14808@shell> (raw)
In-Reply-To: <4C168DEC.1040106@redhat.com>

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:

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,
 #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

  reply	other threads:[~2010-06-14 20:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 13:39 E2fsprogs master branch now has all 64-bit patch applied Theodore Ts'o
2010-06-14 14:41 ` Eric Sandeen
2010-06-14 14:46 ` Ric Wheeler
2010-06-14 20:15 ` Eric Sandeen
2010-06-14 20:26   ` Valerie Aurora [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-21 13:59 陳炫廷
2010-06-21 17:02 Andreas Dilger
     [not found] <AANLkTilD3D2QOXi1b7oXT2uFBx_vuO803HOX4JJXfWG0@mail.gmail.com>
2010-06-21 17:05 ` tytso
2010-06-22  9:15   ` Hsuan-Ting
2010-06-22 16:17     ` Andreas Dilger
2010-06-23  8:42       ` Hsuan-Ting
2010-06-23 11:00         ` Hsuan-Ting
2010-06-25 10:33     ` Hsuan-Ting
2010-06-25 18:23       ` Andreas Dilger
2010-06-29 13:41         ` Hsuan-Ting

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=20100614202655.GB14808@shell \
    --to=vaurora@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).