[PATCH v3 3/8] ovl: make the root inode appear hashed
From: Josef Bacik
Date: Wed Nov 04 2026 - 19:48:45 EST
__mark_inode_dirty() does not put an unhashed inode on a dirty list, and
the root inode of an overlay is never hashed. Use inode_fake_hash() on it,
so that the following patches can track it like any other overlay inode.
Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
---
fs/overlayfs/super.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index efa4d862039c..55635648b3de 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1372,6 +1372,11 @@ static struct dentry *ovl_get_root(struct super_block *sb,
ovl_set_flag(OVL_WHITEOUTS, d_inode(root));
ovl_dentry_set_flag(OVL_E_CONNECTED, root);
ovl_set_upperdata(d_inode(root));
+ /*
+ * Nobody looks the root up by its hash, but __mark_inode_dirty() only
+ * puts hashed inodes on a dirty list.
+ */
+ inode_fake_hash(d_inode(root));
ovl_inode_init(d_inode(root), &oip, ino, fsid);
WARN_ON(!!IS_CASEFOLDED(d_inode(root)) != ofs->casefold);
ovl_dentry_init_flags(root, upperdentry, oe, DCACHE_OP_WEAK_REVALIDATE);
--
2.55.0