<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/dir.c, branch linux-rolling-lts</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-lts'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-09-23T10:29:36Z</updated>
<entry>
<title>ovl: make sure that ovl_create_real() returns a hashed dentry</title>
<updated>2025-09-23T10:29:36Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2025-08-27T17:55:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ad1423922781e6552f18d055a5742b1cff018cdc'/>
<id>urn:sha1:ad1423922781e6552f18d055a5742b1cff018cdc</id>
<content type='text'>
e8bd877fb76bb9f3 ("ovl: fix possible double unlink") added a sanity
check of !d_unhashed(child) to try to verify that child dentry was not
unlinked while parent dir was unlocked.

This "was not unlink" check has a false positive result in the case of
casefolded parent dir, because in that case, ovl_create_temp() returns
an unhashed dentry after ovl_create_real() gets an unhashed dentry from
ovl_lookup_upper() and makes it positive.

To avoid returning unhashed dentry from ovl_create_temp(), let
ovl_create_real() lookup again after making the newdentry positive,
so it always returns a hashed positive dentry (or an error).

This fixes the error in ovl_parent_lock() in ovl_check_rename_whiteout()
after ovl_create_temp() and allows mount of overlayfs with casefolding
enabled layers.

Reported-by: André Almeida &lt;andrealmeid@igalia.com&gt;
Closes: https://lore.kernel.org/r/18704e8c-c734-43f3-bc7c-b8be345e1bf5@igalia.com/
Suggested-by: Neil Brown &lt;neil@brown.name&gt;
Reviewed-by: Neil Brown &lt;neil@brown.name&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: Check for casefold consistency when creating new dentries</title>
<updated>2025-09-23T10:29:36Z</updated>
<author>
<name>André Almeida</name>
</author>
<published>2025-08-14T17:22:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dfc7da402ccc92d6e4b01a4778a3f15f2496b9af'/>
<id>urn:sha1:dfc7da402ccc92d6e4b01a4778a3f15f2496b9af</id>
<content type='text'>
In a overlayfs with casefold enabled, all new dentries should have
casefold enabled as well. Check this at ovl_create_real().

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: André Almeida &lt;andrealmeid@igalia.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: use I_MUTEX_PARENT when locking parent in ovl_create_temp()</title>
<updated>2025-08-18T11:16:38Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-08-04T12:11:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f1c8965e748c150d580a2ea8fbee1bd80d07a24'/>
<id>urn:sha1:5f1c8965e748c150d580a2ea8fbee1bd80d07a24</id>
<content type='text'>
ovl_create_temp() treats "workdir" as a parent in which it creates an
object so it should use I_MUTEX_PARENT.

Prior to the commit identified below the lock was taken by the caller
which sometimes used I_MUTEX_PARENT and sometimes used I_MUTEX_NORMAL.
The use of I_MUTEX_NORMAL was incorrect but unfortunately copied into
ovl_create_temp().

Note to backporters: This patch only applies after the last Fixes given
below (post v6.16).  To fix the bug in v6.7 and later the
inode_lock() call in ovl_copy_up_workdir() needs to nest using
I_MUTEX_PARENT.

Link: https://lore.kernel.org/all/67a72070.050a0220.3d72c.0022.GAE@google.com/
Cc: stable@vger.kernel.org
Reported-by: syzbot+7836a68852a10ec3d790@syzkaller.appspotmail.com
Tested-by: syzbot+7836a68852a10ec3d790@syzkaller.appspotmail.com
Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held")
Fixes: d2c995581c7c ("ovl: Call ovl_create_temp() without lock held.")
Signed-off-by: NeilBrown &lt;neil@brown.name&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: properly print correct variable</title>
<updated>2025-07-25T08:20:36Z</updated>
<author>
<name>Antonio Quartulli</name>
</author>
<published>2025-07-21T20:38:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=672820a070ea5e6ae114f6109726a4e18313a527'/>
<id>urn:sha1:672820a070ea5e6ae114f6109726a4e18313a527</id>
<content type='text'>
In case of ovl_lookup_temp() failure, we currently print `err`
which is actually not initialized at all.

Instead, properly print PTR_ERR(whiteout) which is where the
actual error really is.

Address-Coverity-ID: 1647983 ("Uninitialized variables  (UNINIT)")
Fixes: 8afa0a7367138 ("ovl: narrow locking in ovl_whiteout()")
Signed-off-by: Antonio Quartulli &lt;antonio@mandelbit.com&gt;
Link: https://lore.kernel.org/20250721203821.7812-1-antonio@mandelbit.com
Reviewed-by: NeilBrown &lt;neil@brown.name&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: rename ovl_cleanup_unlocked() to ovl_cleanup()</title>
<updated>2025-07-18T09:10:43Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-07-16T00:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe4d3360f9cbb513be6d74bdeb154728cad5c437'/>
<id>urn:sha1:fe4d3360f9cbb513be6d74bdeb154728cad5c437</id>
<content type='text'>
The only remaining user of ovl_cleanup() is ovl_cleanup_locked(), so we
no longer need both.

This patch renames ovl_cleanup() to ovl_cleanup_locked() and makes it
static.
ovl_cleanup_unlocked() is renamed to ovl_cleanup().

Signed-off-by: NeilBrown &lt;neil@brown.name&gt;
Link: https://lore.kernel.org/20250716004725.1206467-22-neil@brown.name
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: change ovl_create_real() to receive dentry parent</title>
<updated>2025-07-18T09:10:43Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-07-16T00:44:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee37c3cfc5df9013dadf42919ca65510abc15632'/>
<id>urn:sha1:ee37c3cfc5df9013dadf42919ca65510abc15632</id>
<content type='text'>
Instead of passing an inode *dir, pass a dentry *parent.  This makes the
calling slightly cleaner.

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neil@brown.name&gt;
Link: https://lore.kernel.org/20250716004725.1206467-21-neil@brown.name
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: narrow locking in ovl_whiteout()</title>
<updated>2025-07-18T09:10:42Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-07-16T00:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8afa0a736713898f04d52abad69c07caa2c2f227'/>
<id>urn:sha1:8afa0a736713898f04d52abad69c07caa2c2f227</id>
<content type='text'>
ovl_whiteout() relies on the workdir i_rwsem to provide exclusive access
to ofs-&gt;whiteout which it manipulates.  Rather than depending on this,
add a new mutex, "whiteout_lock" to explicitly provide the required
locking.  Use guard(mutex) for this so that we can return without
needing to explicitly unlock.

Then take the lock on workdir only when needed - to lookup the temp name
and to do the whiteout or link.

Signed-off-by: NeilBrown &lt;neil@brown.name&gt;
Link: https://lore.kernel.org/20250716004725.1206467-19-neil@brown.name
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: change ovl_cleanup_and_whiteout() to take rename lock as needed</title>
<updated>2025-07-18T09:10:42Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-07-16T00:44:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2fa14cf2dca1913054e0225377d0a9999483d34d'/>
<id>urn:sha1:2fa14cf2dca1913054e0225377d0a9999483d34d</id>
<content type='text'>
Rather than locking the directory(s) before calling
ovl_cleanup_and_whiteout(), change it (and ovl_whiteout()) to do the
locking, so the locking can be fine grained as will be needed for
proposed locking changes.

Sometimes this is called to whiteout something in the index dir, in
which case only that dir must be locked.  In one case it is called on
something in an upperdir, so two directories must be locked.  We use
ovl_lock_rename_workdir() for this and remove the restriction that
upperdir cannot be indexdir - because now sometimes it is.

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neil@brown.name&gt;
Link: https://lore.kernel.org/20250716004725.1206467-18-neil@brown.name
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: narrow locking on ovl_remove_and_whiteout()</title>
<updated>2025-07-18T09:10:42Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-07-16T00:44:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c69566b1d11d781d6b586113126ce1a803bbf8fc'/>
<id>urn:sha1:c69566b1d11d781d6b586113126ce1a803bbf8fc</id>
<content type='text'>
This code:
  performs a lookup_upper
  creates a whiteout object
  renames the whiteout over the result of the lookup

The create and the rename must be locked separately for proposed
directory locking changes.  This patch takes a first step of moving the
lookup out of the locked region.  A subsequent patch will separate the
create from the rename.

Signed-off-by: NeilBrown &lt;neil@brown.name&gt;
Link: https://lore.kernel.org/20250716004725.1206467-17-neil@brown.name
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: narrow locking in ovl_rename()</title>
<updated>2025-07-18T09:10:41Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2025-07-16T00:44:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05468498cd2fc5b65e18eb80cdce8ae6ee6c9a77'/>
<id>urn:sha1:05468498cd2fc5b65e18eb80cdce8ae6ee6c9a77</id>
<content type='text'>
Drop the rename lock immediately after the rename, and use
ovl_cleanup_unlocked() for cleanup.

This makes way for future changes where locks are taken on individual
dentries rather than the whole directory.

Signed-off-by: NeilBrown &lt;neil@brown.name&gt;
Link: https://lore.kernel.org/20250716004725.1206467-10-neil@brown.name
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
</feed>
