Whamcloud - gitweb
libext2fs: Always swab the MMP block on big-endian systems machines
authorDarrick J. Wong <djwong@us.ibm.com>
Fri, 30 Sep 2011 19:41:26 +0000 (12:41 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 1 Oct 2011 01:28:30 +0000 (21:28 -0400)
commit9026b3db3af838983ed81aad2b4d5e09df1013e3
tree381c2052c6660113358e6c8e5c47fe072ceb7aaf
parent1660034c0a0c7199b0843909c756f8f9e42b85f5
libext2fs: Always swab the MMP block on big-endian systems machines

The MMP code in libext2fs tries to gate MMP block swab'ing with this
test:

if (fs->super->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC))

However, EXT2FS_ENABLE_SWAPFS never seems to be defined anywhere (all
possible existed, the field fs->super->s_magic is always in host
byteorder, so the test always fails.  So, we can change the #ifdef to
WORDS_BIGENDIAN (which is conditionally defined on BE platforms) and
get rid of the broken if test.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/mmp.c