summaryrefslogtreecommitdiff
path: root/fs/overlayfs/super.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-06-17 11:00:24 +0300
committerAmir Goldstein <amir73il@gmail.com>2023-06-19 14:02:00 +0300
commit367d002d6cd21b8f0afe710cd9276fffe7b56d69 (patch)
tree506f129587d25af51f5a94136c94ac4f6ecee614 /fs/overlayfs/super.c
parente4599d4b1aeff031d5764b25b37100b4f98148fc (diff)
ovl: clarify ovl_get_root() semantics
Change the semantics to take a reference on upperdentry instead of transferrig the reference. This is needed for upcoming port to new mount api. Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r--fs/overlayfs/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index ee9adb413d0e..280f2aa2f356 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1922,6 +1922,8 @@ static struct dentry *ovl_get_root(struct super_block *sb,
ovl_set_upperdata(d_inode(root));
ovl_inode_init(d_inode(root), &oip, ino, fsid);
ovl_dentry_init_flags(root, upperdentry, oe, DCACHE_OP_WEAK_REVALIDATE);
+ /* root keeps a reference of upperdentry */
+ dget(upperdentry);
return root;
}
@@ -2100,7 +2102,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
if (!root_dentry)
goto out_free_oe;
- mntput(upperpath.mnt);
+ path_put(&upperpath);
kfree(splitlower);
sb->s_root = root_dentry;