ovl: do not set overlay.opaque on non-dir create

The optimization for opaque dir create was wrongly being applied
also to non-dir create.

Fixes: 97c684cc91 ("ovl: create directories inside merged parent opaque")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org> # v4.10
This commit is contained in:
Amir Goldstein 2017-04-24 22:26:40 +03:00 committed by Miklos Szeredi
parent b0990fbbbd
commit 4a99f3c83d
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}