Skip to content

Commit

Permalink
ovl: do not set overlay.opaque on non-dir create
Browse files Browse the repository at this point in the history
The optimization for opaque dir create was wrongly being applied
also to non-dir create.

Fixes: 97c684c ("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
  • Loading branch information
Amir Goldstein authored and Miklos Szeredi committed Apr 26, 2017
1 parent b0990fb commit 4a99f3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/overlayfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4a99f3c

Please sign in to comment.