From: Amir Goldstein Date: Mon, 24 Apr 2017 19:26:40 +0000 (+0300) Subject: ovl: do not set overlay.opaque on non-dir create X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4a99f3c83dc493c8ea84693d78cd792839c8aa64;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: 97c684cc9110 ("ovl: create directories inside merged parent opaque") Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi Cc: # v4.10 --- diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 6515796460df..bfabc65fdc74 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); }