4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amir Goldstein <amir7...@gmail.com>

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 <amir7...@gmail.com>
Signed-off-by: Miklos Szeredi <mszer...@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 fs/overlayfs/dir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -209,7 +209,7 @@ static int ovl_create_upper(struct dentr
        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);
        }


Reply via email to