diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 6515796460dfe170fb33b109feb09c9ac0b17519..bfabc65fdc74987030fa44889cadfac3e9875ee2 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -210,7 +210,7 @@ static int ovl_create_upper(struct dentry *dentry, struct inode *inode, if (err) goto out_dput; - if (ovl_type_merge(dentry->d_parent)) { + if (ovl_type_merge(dentry->d_parent) && d_is_dir(newdentry)) { /* Setting opaque here is just an optimization, allow to fail */ ovl_set_opaque(dentry, newdentry); }