]>
Commit | Line | Data |
---|---|---|
5032628c GKH |
1 | From 4a99f3c83dc493c8ea84693d78cd792839c8aa64 Mon Sep 17 00:00:00 2001 |
2 | From: Amir Goldstein <amir73il@gmail.com> | |
3 | Date: Mon, 24 Apr 2017 22:26:40 +0300 | |
4 | Subject: ovl: do not set overlay.opaque on non-dir create | |
5 | ||
6 | From: Amir Goldstein <amir73il@gmail.com> | |
7 | ||
8 | commit 4a99f3c83dc493c8ea84693d78cd792839c8aa64 upstream. | |
9 | ||
10 | The optimization for opaque dir create was wrongly being applied | |
11 | also to non-dir create. | |
12 | ||
13 | Fixes: 97c684cc9110 ("ovl: create directories inside merged parent opaque") | |
14 | Signed-off-by: Amir Goldstein <amir73il@gmail.com> | |
15 | Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | ||
18 | --- | |
19 | fs/overlayfs/dir.c | 2 +- | |
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
21 | ||
22 | --- a/fs/overlayfs/dir.c | |
23 | +++ b/fs/overlayfs/dir.c | |
24 | @@ -210,7 +210,7 @@ static int ovl_create_upper(struct dentr | |
25 | if (err) | |
26 | goto out_dput; | |
27 | ||
28 | - if (ovl_type_merge(dentry->d_parent)) { | |
29 | + if (ovl_type_merge(dentry->d_parent) && d_is_dir(newdentry)) { | |
30 | /* Setting opaque here is just an optimization, allow to fail */ | |
31 | ovl_set_opaque(dentry, newdentry); | |
32 | } |