Skip to content

Commit c54719c

Browse files
Al Viroamir73il
authored andcommitted
ovl: fetch inode once in ovl_dentry_revalidate_common()
d_inode_rcu() is right - we might be in rcu pathwalk; however, OVL_E() hides plain d_inode() on the same dentry... Fixes: a6ff2bc ("ovl: use OVL_E() and OVL_E_FLAGS() accessors") Signed-off-by: Al Viro <[email protected]> Signed-off-by: Amir Goldstein <[email protected]>
1 parent d9e8319 commit c54719c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/overlayfs/super.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ static int ovl_revalidate_real(struct dentry *d, unsigned int flags, bool weak)
104104
static int ovl_dentry_revalidate_common(struct dentry *dentry,
105105
unsigned int flags, bool weak)
106106
{
107-
struct ovl_entry *oe = OVL_E(dentry);
108-
struct ovl_path *lowerstack = ovl_lowerstack(oe);
107+
struct ovl_entry *oe;
108+
struct ovl_path *lowerstack;
109109
struct inode *inode = d_inode_rcu(dentry);
110110
struct dentry *upper;
111111
unsigned int i;
@@ -115,6 +115,8 @@ static int ovl_dentry_revalidate_common(struct dentry *dentry,
115115
if (!inode)
116116
return -ECHILD;
117117

118+
oe = OVL_I_E(inode);
119+
lowerstack = ovl_lowerstack(oe);
118120
upper = ovl_i_dentry_upper(inode);
119121
if (upper)
120122
ret = ovl_revalidate_real(upper, flags, weak);

0 commit comments

Comments
 (0)