All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e2fsprogs- fix ext2fs_swap_inode_full attr test on BE boxes
@ 2008-02-29 22:10 Eric Sandeen
  2008-03-14 13:09 ` Matthias Koenig
  2008-03-14 17:14 ` Theodore Tso
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2008-02-29 22:10 UTC (permalink / raw)
  To: ext4 development

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>
---

Index: e2fsprogs-1.40.7/lib/ext2fs/swapfs.c
===================================================================
--- e2fsprogs-1.40.7.orig/lib/ext2fs/swapfs.c
+++ e2fsprogs-1.40.7/lib/ext2fs/swapfs.c
@@ -133,7 +133,7 @@ void ext2fs_swap_inode_full(ext2_filsys 
 			    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;
 
@@ -231,13 +231,17 @@ void ext2fs_swap_inode_full(ext2_filsys 
 
 	eaf = (__u32 *) (((char *) f) + sizeof(struct ext2_inode) +
 					extra_isize);
-
-	if (ext2fs_swab32(*eaf) != EXT2_EXT_ATTR_MAGIC)
-		return; /* it seems no magic here */

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-03-14 17:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-29 22:10 [PATCH] e2fsprogs- fix ext2fs_swap_inode_full attr test on BE boxes Eric Sandeen
2008-03-14 13:09 ` Matthias Koenig
2008-03-14 13:32   ` Theodore Tso
2008-03-14 14:13     ` Eric Sandeen
2008-03-14 14:40       ` Theodore Tso
2008-03-14 17:14 ` Theodore Tso
2008-03-14 17:42   ` Eric Sandeen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.