]> git.hungrycats.org Git - linux/commitdiff
ovl: do not set overlay.opaque on non-dir create
authorAmir Goldstein <amir73il@gmail.com>
Mon, 24 Apr 2017 19:26:40 +0000 (22:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 May 2017 12:49:47 +0000 (14:49 +0200)
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>
fs/overlayfs/dir.c

index 6515796460dfe170fb33b109feb09c9ac0b17519..bfabc65fdc74987030fa44889cadfac3e9875ee2 100644 (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);
        }