Re: [PATCH 17/32] xfs: parent pointer attribute creation

Christoph Hellwig
2024-04-10T05:44:59Z

One thing that might be worth documenting in a comment or at least
the commit log is why we have this three phase split between
allocating the daargs, doing all the work and freeing it.

As far as I can tell that is because the da_args need to be around
until transaction commit because xfs_attr_intent has a pointer to
the da_args and not a full copy. So unless the attrs are on stack
they need to be free after transaction commit, and as the normal
dir operation args are not on the stack we don't want to add the
attr one to the stack here. We could probably allocate the da_args
in the main parent pointer helpers, but that would require a NOFAIL
allocation and maybe lead to odd calling conventions, but maybe
someone directly involved can further refine that reasoning.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>