mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-28 20:44:08 +08:00
Fix ext2fs_swap_inode_full() for in-inode xattrs on big-endian machines
After the fix for resize2fs's inode mover losing in-inode extended attributes, the regression test I wrote caught that the attrs were still getting lost on powerpc. Looks like the problem is that ext2fs_swap_inode_full() isn't paying attention to whether or not the EA magic is in hostorder, so it's not recognized (and not swapped) on BE machines. Patch below seems to fix it. Yay for regression tests. ;) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
da078326b6
commit
82e541885e
@ -133,7 +133,7 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
|
||||
struct ext2_inode_large *f, int hostorder,
|
||||
int bufsize)
|
||||
{
|
||||
unsigned i, has_data_blocks, extra_isize;
|
||||
unsigned i, has_data_blocks, extra_isize, attr_magic;
|
||||
int islnk = 0;
|
||||
__u32 *eaf, *eat;
|
||||
|
||||
@ -232,7 +232,11 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
|
||||
eaf = (__u32 *) (((char *) f) + sizeof(struct ext2_inode) +
|
||||
extra_isize);
|
||||
|
||||
if (ext2fs_swab32(*eaf) != EXT2_EXT_ATTR_MAGIC)
|
||||
attr_magic = *eaf;
|
||||
if (!hostorder)
|
||||
attr_magic = ext2fs_swab32(attr_magic);
|
||||
|
||||
if (attr_magic != EXT2_EXT_ATTR_MAGIC)
|
||||
return; /* it seems no magic here */
|
||||
|
||||
eat = (__u32 *) (((char *) t) + sizeof(struct ext2_inode) +
|
||||
|
Loading…
Reference in New Issue
Block a user