]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: fix extent header in do_write for big-endian machines
authorTheodore Ts'o <tytso@mit.edu>
Wed, 25 Dec 2013 03:40:01 +0000 (22:40 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 25 Dec 2013 03:50:23 +0000 (22:50 -0500)
Commit a17e9f30 set up the extent header for a new file.
Unfortunately it didn't correctly handle byte swapping; fix this so
the regression tests pass on PowerPC systems.

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

index 095741f71fa1b38c51c6ac54c5fb00fa4b0c4685..cf7670bc1514786f15aee37770ea61b8671497a1 100644 (file)
@@ -1726,7 +1726,7 @@ void do_write(int argc, char *argv[])
                eh = (struct ext3_extent_header *) &inode.i_block[0];
                eh->eh_depth = 0;
                eh->eh_entries = 0;
-               eh->eh_magic = EXT3_EXT_MAGIC;
+               eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
                i = (sizeof(inode.i_block) - sizeof(*eh)) /
                        sizeof(struct ext3_extent);
                eh->eh_max = ext2fs_cpu_to_le16(i);