summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-04-24 22:26:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-20 15:31:02 +0300
commit586aa5a6537f0f5f67487ec3f535488e77bbba82 (patch)
tree93a6e2f9e2cd99d2e4aa7f2ce438688894728bce
parentcf95696518f5ffdf98b64df850fe6bcf208f4a4f (diff)
downloadlinux-586aa5a6537f0f5f67487ec3f535488e77bbba82.tar.xz
ovl: do not set overlay.opaque on non-dir create
commit 4a99f3c83dc493c8ea84693d78cd792839c8aa64 upstream. The optimization for opaque dir create was wrongly being applied also to non-dir create. Fixes: 97c684cc9110 ("ovl: create directories inside merged parent opaque") Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/overlayfs/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index 16e06dd89457..2e1f16d22c16 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -209,7 +209,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);
}