Re: [GIT PULL] non-MM updates for 6.19-rc1

From: Mark Fasheh

Date: Mon Dec 08 2025 - 14:08:13 EST


On Sun, Dec 7, 2025 at 11:58 PM Heming Zhao <heming.zhao@xxxxxxxx> wrote:
>
> On Mon, Dec 08, 2025 at 12:01:09PM +0800, Joseph Qi wrote:
> > It seems now new_xh->xh_count is 0. That's means, it is trying to add a
> > new entry and here 'last' is pointing the next free entry.
> > If so, the original code seems right.
> >
> > Heming, could you please verify this? I'm not familiar with this logic...
> >
> > Thanks,
> > Joseph

Thanks Joseph and Heming for looking into this.


> In ocfs2_reflink_xattrs(), when preserve_security is false, the function sets
> 'args.xattr_reflinked'. IMUC, it means that if users want to preserve security
> xattr items, the args.xattr_reflinked is NULL, this then results in
> ocfs2_reflink_xattr_header() not executing the cleanup jobs, (in the code area
> defined by "if (args->xattr_reflinked && !args->xattr_reflinked(xe))").
>
> Regarding the clean jobs:
> - by default, it only handles three types:
> OCFS2_XATTR_INDEX_[SECURITY|POSIX_ACL_ACCESS|POSIX_ACL_DEFAULT]
> - it cleans the first item and shifts forward the remaining items.
>
> It seems Linus' patch does not handle all cases. If new_xh->xh_count is 1,
> le16_add_cpu(&new_xh->xh_count, -1) makes it to 0, and it will miss the cleanup
> job.

It's been a while since I've look at Ocfs2 xattr so take what I say
with a grain of salt :)

That said, I agree that the cleanup code looks suspect. I think the
answer is to always memset the entry that we just removed even when
xh_count becomes zero.

Thanks,
--Mark