Whamcloud - gitweb
e2fsck: Fix extent flag validity tests in pass1 on big endian boxes.
authorEric Sandeen <sandeen@redhat.com>
Tue, 1 Apr 2008 19:18:44 +0000 (15:18 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 1 Apr 2008 19:18:44 +0000 (15:18 -0400)
commitdfc870c718d22054ee6e8d607fcec76dd6f8e17d
tree3d4a62f4fcba31b89455f490defd8025af794feb
parentb89fc30dd7ff8a81b195296299564df9c1ff5433
e2fsck: Fix extent flag validity tests in pass1 on big endian boxes.

Extent data is shared with the i_block[] space in the inode,
but it is always swapped on access, not when the inode is read.

In e2fsck/pass1.c we must be careful when checking validity
of the extents flag on the inode.  If the flag was set when
the inode was read & swapped, then the extents data itself
(in ->i_block[]) was NOT swapped, so testing for a valid
extent header requires some swapping first.  Then, if we
ultimately set the extents flag, all of i_block[] must be
re/un-swapped.

This passes the f_extent regression test on both ppc & x86.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c