e2fsprogs/e2fsprogs-1.40.2-swapfs.patch
Eric Sandeen 1ac029d892 * Wed Jul 18 2007 Eric Sandeen <esandeen@redhat.com> 1.40.2-2
- Fix bug in ext2fs_swap_inode_full() on big-endian boxes
2007-07-18 16:48:31 +00:00

36 lines
1.4 KiB
Diff

From db9097caca17401313c0dc840b4ae683e5b5c1df Mon Sep 17 00:00:00 2001
From: Eric Sandeen <sandeen@redhat.com>
Date: Tue, 17 Jul 2007 20:40:25 -0500
Subject: [PATCH] Fix big-endian byte-swapping bug in ext2fs_swap_inode_full()
We need to set t->i_file_acl before we test it in
ext2fs_inode_data_blocks()
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
lib/ext2fs/swapfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
index a40caa9..6576c59 100644
--- a/lib/ext2fs/swapfs.c
+++ b/lib/ext2fs/swapfs.c
@@ -150,6 +150,7 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
t->i_dtime = ext2fs_swab32(f->i_dtime);
t->i_gid = ext2fs_swab16(f->i_gid);
t->i_links_count = ext2fs_swab16(f->i_links_count);
+ t->i_file_acl = ext2fs_swab32(f->i_file_acl);
if (hostorder)
has_data_blocks = ext2fs_inode_data_blocks(fs,
(struct ext2_inode *) f);
@@ -158,7 +159,6 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
has_data_blocks = ext2fs_inode_data_blocks(fs,
(struct ext2_inode *) t);
t->i_flags = ext2fs_swab32(f->i_flags);
- t->i_file_acl = ext2fs_swab32(f->i_file_acl);
t->i_dir_acl = ext2fs_swab32(f->i_dir_acl);
if (!islnk || has_data_blocks ) {
for (i = 0; i < EXT2_N_BLOCKS; i++)