From: Gao Xiang <xiang@kernel.org>
To: Martin Pitt <martin@piware.de>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <xiang@kernel.org>,
Yifan Zhao <zhaoyifan28@huawei.com>
Subject: Re: [PATCH v2] erofs-utils: mkfs: emit an inode's xattrs in a canonical order
Date: Tue, 4 Aug 2026 07:23:27 +0800 [thread overview]
Message-ID: <anEi7yIiNTJ74jnv@XiangdeMacBook-Pro.local> (raw)
In-Reply-To: <anCBBdM7yw9Mm3xg@piware.de>
On Mon, Aug 03, 2026 at 01:52:37PM +0200, Martin Pitt wrote:
> listxattr(2) makes no promise about the order it reports, and
> filesystems disagree: tmpfs reports them in insertion order on recent
> kernels (or in a random order on older ones), while ext4 and btrfs
> report their own on-disk order.
>
> mkfs.erofs stored an inode's attributes in exactly the order it received
> them, so staging the same tree on different filesystems (or on older
> kernels merely twice in the same place) produced images that differed
> byte for byte. That made EROFS images unreproducible.
>
> Insert into the inode's list ordered by attribute name instead, and move
> inline attributes onto the on-stack list with list_add_tail() so the
> emitted order matches. The shared attribute pool already sorts by the
> same key, so generalize comp_shared_xattritem() into
> erofs_comp_xattritem() and use it for both.
>
> The length tiebreak previously returned only 0 or 1, never a negative
> value; make it a proper three-way comparison with cmpsgn().
>
> Suggested-by: Gao Xiang <xiang@kernel.org>
> Signed-off-by: Martin Pitt <martin@amutable.com>
Thanks, applied.
Thanks,
Gao Xiang
prev parent reply other threads:[~2026-08-03 23:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 11:52 [PATCH v2] erofs-utils: mkfs: emit an inode's xattrs in a canonical order Martin Pitt
2026-08-03 23:23 ` Gao Xiang [this message]
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=anEi7yIiNTJ74jnv@XiangdeMacBook-Pro.local \
--to=xiang@kernel.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=martin@piware.de \
--cc=zhaoyifan28@huawei.com \
/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.