<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/udf/namei.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-02-27T19:00:17Z</updated>
<entry>
<title>Change inode_operations.mkdir to return struct dentry *</title>
<updated>2025-02-27T19:00:17Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-02-27T01:32:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88d5baf69082e5b410296435008329676b687549'/>
<id>urn:sha1:88d5baf69082e5b410296435008329676b687549</id>
<content type='text'>
Some filesystems, such as NFS, cifs, ceph, and fuse, do not have
complete control of sequencing on the actual filesystem (e.g.  on a
different server) and may find that the inode created for a mkdir
request already exists in the icache and dcache by the time the mkdir
request returns.  For example, if the filesystem is mounted twice the
directory could be visible on the other mount before it is on the
original mount, and a pair of name_to_handle_at(), open_by_handle_at()
calls could instantiate the directory inode with an IS_ROOT() dentry
before the first mkdir returns.

This means that the dentry passed to -&gt;mkdir() may not be the one that
is associated with the inode after the -&gt;mkdir() completes.  Some
callers need to interact with the inode after the -&gt;mkdir completes and
they currently need to perform a lookup in the (rare) case that the
dentry is no longer hashed.

This lookup-after-mkdir requires that the directory remains locked to
avoid races.  Planned future patches to lock the dentry rather than the
directory will mean that this lookup cannot be performed atomically with
the mkdir.

To remove this barrier, this patch changes -&gt;mkdir to return the
resulting dentry if it is different from the one passed in.
Possible returns are:
  NULL - the directory was created and no other dentry was used
  ERR_PTR() - an error occurred
  non-NULL - this other dentry was spliced in

This patch only changes file-systems to return "ERR_PTR(err)" instead of
"err" or equivalent transformations.  Subsequent patches will make
further changes to some file-systems to return a correct dentry.

Not all filesystems reliably result in a positive hashed dentry:

- NFS, cifs, hostfs will sometimes need to perform a lookup of
  the name to get inode information.  Races could result in this
  returning something different. Note that this lookup is
  non-atomic which is what we are trying to avoid.  Placing the
  lookup in filesystem code means it only happens when the filesystem
  has no other option.
- kernfs and tracefs leave the dentry negative and the -&gt;revalidate
  operation ensures that lookup will be called to correctly populate
  the dentry.  This could be fixed but I don't think it is important
  to any of the users of vfs_mkdir() which look at the dentry.

The recommendation to use
    d_drop();d_splice_alias()
is ugly but fits with current practice.  A planned future patch will
change this.

Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Link: https://lore.kernel.org/r/20250227013949.536172-2-neilb@suse.de
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>udf: Verify inode link counts before performing rename</title>
<updated>2024-11-26T21:54:24Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2024-11-26T11:55:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6756af923e06aa33ad8894aaecbf9060953ba00f'/>
<id>urn:sha1:6756af923e06aa33ad8894aaecbf9060953ba00f</id>
<content type='text'>
During rename, we are updating link counts of various inodes either when
rename deletes target or when moving directory across directories.
Verify involved link counts are sane so that we don't trip warnings in
VFS.

Reported-by: syzbot+3ff7365dc04a6bcafa66@syzkaller.appspotmail.com
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>udf: Skip parent dir link count update if corrupted</title>
<updated>2024-11-26T21:54:24Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2024-11-26T11:46:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c5566903af56dd1abb092f18dcb0c770d6cd8dcb'/>
<id>urn:sha1:c5566903af56dd1abb092f18dcb0c770d6cd8dcb</id>
<content type='text'>
If the parent directory link count is too low (likely directory inode
corruption), just skip updating its link count as if it goes to 0 too
early it can cause unexpected issues.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>udf: Fix bogus checksum computation in udf_rename()</title>
<updated>2024-06-20T13:07:27Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2024-06-17T15:41:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=27ab33854873e6fb958cb074681a0107cc2ecc4c'/>
<id>urn:sha1:27ab33854873e6fb958cb074681a0107cc2ecc4c</id>
<content type='text'>
Syzbot reports uninitialized memory access in udf_rename() when updating
checksum of '..' directory entry of a moved directory. This is indeed
true as we pass on-stack diriter.fi to the udf_update_tag() and because
that has only struct fileIdentDesc included in it and not the impUse or
name fields, the checksumming function is going to checksum random stack
contents beyond the end of the structure. This is actually harmless
because the following udf_fiiter_write_fi() will recompute the checksum
from on-disk buffers where everything is properly included. So all that
is needed is just removing the bogus calculation.

Fixes: e9109a92d2a9 ("udf: Convert udf_rename() to new directory iteration code")
Link: https://lore.kernel.org/all/000000000000cf405f060d8f75a9@google.com/T/
Link: https://patch.msgid.link/20240617154201.29512-1-jack@suse.cz
Reported-by: syzbot+d31185aa54170f7fc1f5@syzkaller.appspotmail.com
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>udf: Avoid GFP_NOFS allocation in udf_symlink()</title>
<updated>2024-01-23T18:21:10Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2024-01-09T10:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2ed0d3d4fee199869e9aef09bc86ceed9d79b978'/>
<id>urn:sha1:2ed0d3d4fee199869e9aef09bc86ceed9d79b978</id>
<content type='text'>
The GFP_NOFS allocation in udf_symlink() is called only under
inode-&gt;i_rwsem and UDF_I(inode)-&gt;i_data_sem. The first is safe wrt
reclaim, the second should be as well but allocating unde this lock is
actually unnecessary. Move the allocation from under i_data_sem and
change it to GFP_KERNEL.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>udf: Remove GFP_NOFS from dir iteration code</title>
<updated>2024-01-23T18:21:10Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2024-01-09T10:00:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f6766303c0f2ffbcc640ef2701984a81a274aff2'/>
<id>urn:sha1:f6766303c0f2ffbcc640ef2701984a81a274aff2</id>
<content type='text'>
Directory iteration code was using GFP_NOFS allocations in two places.
However the code is called only under inode-&gt;i_rwsem which is generally
safe wrt reclaim. So we can do the allocations with GFP_KERNEL instead.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2024-01-12T04:23:50Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-01-12T04:23:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=488926926a1653adfda3f662355907c896524487'/>
<id>urn:sha1:488926926a1653adfda3f662355907c896524487</id>
<content type='text'>
Pull misc filesystem updates from Al Viro:
 "Misc cleanups (the part that hadn't been picked by individual fs
  trees)"

* tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  apparmorfs: don't duplicate kfree_link()
  orangefs: saner arguments passing in readdir guts
  ocfs2_find_match(): there's no such thing as NULL or negative -&gt;d_parent
  reiserfs_add_entry(): get rid of pointless namelen checks
  __ocfs2_add_entry(), ocfs2_prepare_dir_for_insert(): namelen checks
  ext4_add_entry(): -&gt;d_name.len is never 0
  befs: d_obtain_alias(ERR_PTR(...)) will do the right thing
  affs: d_obtain_alias(ERR_PTR(...)) will do the right thing
  /proc/sys: use d_splice_alias() calling conventions to simplify failure exits
  hostfs: use d_splice_alias() calling conventions to simplify failure exits
  udf_fiiter_add_entry(): check for zero -&gt;d_name.len is bogus...
  udf: d_obtain_alias(ERR_PTR(...)) will do the right thing...
  udf: d_splice_alias() will do the right thing on ERR_PTR() inode
  nfsd: kill stale comment about simple_fill_super() requirements
  bfs_add_entry(): get rid of pointless -&gt;d_name.len checks
  nilfs2: d_obtain_alias(ERR_PTR(...)) will do the right thing...
  zonefs: d_splice_alias() will do the right thing on ERR_PTR() inode
</content>
</entry>
<entry>
<title>udf_fiiter_add_entry(): check for zero -&gt;d_name.len is bogus...</title>
<updated>2023-12-21T17:50:31Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2023-11-12T22:12:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e7582f6e3a89d2fecf0a08e44ee02780c4cb4cf'/>
<id>urn:sha1:5e7582f6e3a89d2fecf0a08e44ee02780c4cb4cf</id>
<content type='text'>
Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>udf: d_obtain_alias(ERR_PTR(...)) will do the right thing...</title>
<updated>2023-12-21T17:49:36Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2023-11-11T06:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f58b8c3ef7b25582448c262e56f0414c48424952'/>
<id>urn:sha1:f58b8c3ef7b25582448c262e56f0414c48424952</id>
<content type='text'>
Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>udf: d_splice_alias() will do the right thing on ERR_PTR() inode</title>
<updated>2023-12-21T17:49:16Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2023-11-11T06:14:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32328a73e0ad4a1babebf798c309c64ee3b97400'/>
<id>urn:sha1:32328a73e0ad4a1babebf798c309c64ee3b97400</id>
<content type='text'>
Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
