All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Koenig <mkoenig@suse.de>
To: Theodore Ts'o <tytso@mit.edu>, Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] e2fsprogs- fix ext2fs_swap_inode_full attr test on BE boxes
Date: Fri, 14 Mar 2008 14:09:06 +0100	[thread overview]
Message-ID: <n7x63vph2q5.fsf@sor.suse.de> (raw)
In-Reply-To: <47C882CD.3090204@redhat.com> (Eric Sandeen's message of "Fri\, 29 Feb 2008 16\:10\:21 -0600")

Eric Sandeen <sandeen@redhat.com> writes:

> 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 */
> -
>  	eat = (__u32 *) (((char *) t) + sizeof(struct ext2_inode) +
>  					extra_isize);
> +
> +	if (hostorder)
> +		attr_magic = *eaf;
>  	*eat = ext2fs_swab32(*eaf);
> +	if (!hostorder)
> +		attr_magic = *eat;
> +
> +	if (attr_magic != EXT2_EXT_ATTR_MAGIC)
> +		return; /* it seems no magic here */
>  
>  	/* convert EA(s) */
>  	ext2fs_swap_ext_attr((char *) (eat + 1), (char *) (eaf + 1),
>

This patch seems to be missing in the current e2fsprogs 1.40.8 release
(though announced in the release notes that this issue should be fixed
on BE machines).
Check r_inline_xattr still fails on ppc and s390 architectures without 
this patch. It builds fine with this patch applied.
Could you please check (also the git tag for the 1.40.8 release seems to
be missing).

Thanks,
Matthias

  reply	other threads:[~2008-03-14 13:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=n7x63vph2q5.fsf@sor.suse.de \
    --to=mkoenig@suse.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.