]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: separate the icreate logic around INIT_XATTRS
authorDarrick J. Wong <djwong@kernel.org>
Wed, 2 Oct 2024 01:14:05 +0000 (18:14 -0700)
committerAndrey Albershteyn <aalbersh@redhat.com>
Fri, 4 Oct 2024 10:42:07 +0000 (12:42 +0200)
commita8d4daf12f589b641b542aee5aa42c5f6932aa85
tree227d37b8e1a62752d7e1702f9aaea839fe268d4f
parentc8fa782f3856ba624e26d318a4738a66c90a7e77
xfs: separate the icreate logic around INIT_XATTRS

Source kernel commit: b11b11e3b7a72606cfef527255a9467537bcaaa5

INIT_XATTRS is overloaded here -- it's set during the creat process when
we think that we're immediately going to set some ACL xattrs to save
time.  However, it's also used by the parent pointers code to enable the
attr fork in preparation to receive ppptr xattrs.  This results in
xfs_has_parent() branches scattered around the codebase to turn on
INIT_XATTRS.

Linkable files are created far more commonly than unlinkable temporary
files or directory tree roots, so we should centralize this logic in
xfs_inode_init.  For the three callers that don't want parent pointers
(online repiar tempfiles, unlinkable tempfiles, rootdir creation) we
provide an UNLINKABLE flag to skip attr fork initialization.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_inode_util.c
libxfs/xfs_inode_util.h