Skip to content

Commit 367d002

Browse files
committed
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>
1 parent e4599d4 commit 367d002

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fs/overlayfs/super.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,8 @@ static struct dentry *ovl_get_root(struct super_block *sb,
19221922
ovl_set_upperdata(d_inode(root));
19231923
ovl_inode_init(d_inode(root), &oip, ino, fsid);
19241924
ovl_dentry_init_flags(root, upperdentry, oe, DCACHE_OP_WEAK_REVALIDATE);
1925+
/* root keeps a reference of upperdentry */
1926+
dget(upperdentry);
19251927

19261928
return root;
19271929
}
@@ -2100,7 +2102,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
21002102
if (!root_dentry)
21012103
goto out_free_oe;
21022104

2103-
mntput(upperpath.mnt);
2105+
path_put(&upperpath);
21042106
kfree(splitlower);
21052107

21062108
sb->s_root = root_dentry;

0 commit comments

Comments
 (0)