<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/xfs/xfs_symlink.c, branch v6.12.75</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.75</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.75'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-09-01T15:58:19+00:00</updated>
<entry>
<title>xfs: pass the icreate args object to xfs_dialloc</title>
<updated>2024-09-01T15:58:19+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-08-30T22:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=390b4775d6787706b1846f15623a68e576ec900c'/>
<id>urn:sha1:390b4775d6787706b1846f15623a68e576ec900c</id>
<content type='text'>
Pass the xfs_icreate_args object to xfs_dialloc since we can extract the
relevant mode (really just the file type) and parent inumber from there.
This simplifies the calling convention in preparation for the next
patch.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: move dirent update hooks to xfs_dir2.c</title>
<updated>2024-07-02T18:37:00+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-07-02T18:22:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=62bbf50bea21b1c76990fd1bae58a65660a11c27'/>
<id>urn:sha1:62bbf50bea21b1c76990fd1bae58a65660a11c27</id>
<content type='text'>
Move the directory entry update hook code to xfs_dir2 so that it is
mostly consolidated with the higher level directory functions.  Retain
the exports so that online fsck can still send notifications through the
hooks.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: create libxfs helper to link a new inode into a directory</title>
<updated>2024-07-02T18:36:58+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-07-02T18:22:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1fa2e81957cf11620867729fb613b121692ee0d3'/>
<id>urn:sha1:1fa2e81957cf11620867729fb613b121692ee0d3</id>
<content type='text'>
Create a new libxfs function to link a newly created inode into a
directory.  The upcoming metadata directory feature will need this to
create a metadata directory tree.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: separate the icreate logic around INIT_XATTRS</title>
<updated>2024-07-02T18:36:58+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-07-02T18:22:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b11b11e3b7a72606cfef527255a9467537bcaaa5'/>
<id>urn:sha1:b11b11e3b7a72606cfef527255a9467537bcaaa5</id>
<content type='text'>
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 &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: wrap inode creation dqalloc calls</title>
<updated>2024-07-02T18:36:57+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-07-02T18:22:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c0223b8d66d2b3e8fed86fd80699ef2fef3e53af'/>
<id>urn:sha1:c0223b8d66d2b3e8fed86fd80699ef2fef3e53af</id>
<content type='text'>
Create a helper that calls dqalloc to allocate and grab a reference to
dquots for the user, group, and project ids listed in an icreate
structure.  This simplifies the creat-related dqalloc callsites
scattered around the code base.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: pack icreate initialization parameters into a separate structure</title>
<updated>2024-07-02T18:36:56+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-07-02T18:22:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ba4b39fe4c011078469dcd28f51447d75852d21c'/>
<id>urn:sha1:ba4b39fe4c011078469dcd28f51447d75852d21c</id>
<content type='text'>
Callers that want to create an inode currently pass all possible file
attribute values for the new inode into xfs_init_new_inode as ten
separate parameters.  This causes two code maintenance issues: first, we
have large multi-line call sites which programmers must read carefully
to make sure they did not accidentally invert a value.  Second, all
three file id parameters must be passed separately to the quota
functions; any discrepancy results in quota count errors.

Clean this up by creating a new icreate_args structure to hold all this
information, some helpers to initialize them properly, and make the
callers pass this structure through to the creation function, whose name
we shorten to xfs_icreate.  This eliminates the issues, enables us to
keep the inode init code in sync with userspace via libxfs, and is
needed for future metadata directory tree management.

(A subsequent cleanup will also fix the quota alloc calls.)

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: use consistent uid/gid when grabbing dquots for inodes</title>
<updated>2024-07-02T18:36:55+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-07-02T18:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=24a4e1cb322e2bf0f3a1afd1978b610a23aa8f36'/>
<id>urn:sha1:24a4e1cb322e2bf0f3a1afd1978b610a23aa8f36</id>
<content type='text'>
I noticed that callers of xfs_qm_vop_dqalloc use the following code to
compute the anticipated uid of the new file:

	mapped_fsuid(idmap, &amp;init_user_ns);

whereas the VFS uses a slightly different computation for actually
assigning i_uid:

	mapped_fsuid(idmap, i_user_ns(inode));

Technically, these are not the same things.  According to Christian
Brauner, the only time that inode-&gt;i_sb-&gt;s_user_ns != &amp;init_user_ns is
when the filesystem was mounted in a new mount namespace by an
unpriviledged user.  XFS does not allow this, which is why we've never
seen bug reports about quotas being incorrect or the uid checks in
xfs_qm_vop_create_dqattach tripping debug assertions.

However, this /is/ a logic bomb, so let's make the code consistent.

Link: https://lore.kernel.org/linux-fsdevel/20240617-weitblick-gefertigt-4a41f37119fa@brauner/
Fixes: c14329d39f2d ("fs: port fs{g,u}id helpers to mnt_idmap")
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: add parent attributes to symlink</title>
<updated>2024-04-23T14:46:58+00:00</updated>
<author>
<name>Allison Henderson</name>
<email>allison.henderson@oracle.com</email>
</author>
<published>2024-04-22T16:47:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5d31a85dcc1fa4c5d4a925c6da67751653a700ba'/>
<id>urn:sha1:5d31a85dcc1fa4c5d4a925c6da67751653a700ba</id>
<content type='text'>
This patch modifies xfs_symlink to add a parent pointer to the inode.

Signed-off-by: Allison Henderson &lt;allison.henderson@oracle.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
[djwong: minor rebase fixups]
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: Hold inode locks in xfs_ialloc</title>
<updated>2024-04-15T21:59:02+00:00</updated>
<author>
<name>Allison Henderson</name>
<email>allison.henderson@oracle.com</email>
</author>
<published>2024-04-15T21:55:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=267979b4ce75767a9caf69072e1b92416e286a29'/>
<id>urn:sha1:267979b4ce75767a9caf69072e1b92416e286a29</id>
<content type='text'>
Modify xfs_ialloc to hold locks after return.  Caller will be
responsible for manual unlock.  We will need this later to hold locks
across parent pointer operations

Signed-off-by: Allison Henderson &lt;allison.henderson@oracle.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Catherine Hoang &lt;catherine.hoang@oracle.com&gt;
[djwong: hold the parent ilocked across transaction rolls too]
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>xfs: pass the owner to xfs_symlink_write_target</title>
<updated>2024-04-15T21:58:57+00:00</updated>
<author>
<name>Darrick J. Wong</name>
<email>djwong@kernel.org</email>
</author>
<published>2024-04-15T21:54:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ea8214c3195c2ed3a205dea42bbe7746712fc461'/>
<id>urn:sha1:ea8214c3195c2ed3a205dea42bbe7746712fc461</id>
<content type='text'>
Require callers of xfs_symlink_write_target to pass the owner number
explicitly.  This sets us up for online repair to be able to write a
remote symlink target to sc-&gt;tempip with sc-&gt;ip's inumber in the block
heaader.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
