Skip to contentSkip to conversation

ovl: do not set overlay.opaque on non-dir create

PATCH Applied Amir Goldstein 2 participants 2 messages Apr 24, 2017 – Apr 26, 2017

Subsystems (2)
lore
Share & tools
lore

Amir Goldstein

author maintainer
#0 lore raw

PATCH 1/1 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")
Cc <[email protected]> # v4.10
---
 fs/overlayfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/dir.c +1 -1
index 6ef35e8..5d64550 100644
@@ -228,7 +228,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);
 	}
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 6 lines · Amir Goldstein

The optimization for opaque dir create was wrongly being applied also to non-dir create.

Fixes 97c684cc9110 ("ovl: create directories inside merged parent opaque")
Cc <[email protected]> # v4.10

Thanks, applied.

Miklos

Quoted 20 lines
---
 fs/overlayfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/dir.c +1 -2
index 6ef35e8..5d64550 100644
@@ -228,7 +228,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);
        }
--

2.7.4