diff options
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r-- | fs/overlayfs/super.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index f16d318b71f8..821719cc8537 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c | |||
@@ -64,22 +64,19 @@ const char *ovl_opaque_xattr = "trusted.overlay.opaque"; | |||
64 | enum ovl_path_type ovl_path_type(struct dentry *dentry) | 64 | enum ovl_path_type ovl_path_type(struct dentry *dentry) |
65 | { | 65 | { |
66 | struct ovl_entry *oe = dentry->d_fsdata; | 66 | struct ovl_entry *oe = dentry->d_fsdata; |
67 | enum ovl_path_type type = 0; | ||
67 | 68 | ||
68 | if (oe->__upperdentry) { | 69 | if (oe->__upperdentry) { |
70 | type = __OVL_PATH_UPPER; | ||
71 | |||
69 | if (oe->lowerdentry) { | 72 | if (oe->lowerdentry) { |
70 | if (S_ISDIR(dentry->d_inode->i_mode)) | 73 | if (S_ISDIR(dentry->d_inode->i_mode)) |
71 | return OVL_PATH_MERGE; | 74 | type |= __OVL_PATH_MERGE; |
72 | else | 75 | } else if (!oe->opaque) { |
73 | return OVL_PATH_UPPER; | 76 | type |= __OVL_PATH_PURE; |
74 | } else { | ||
75 | if (oe->opaque) | ||
76 | return OVL_PATH_UPPER; | ||
77 | else | ||
78 | return OVL_PATH_PURE_UPPER; | ||
79 | } | 77 | } |
80 | } else { | ||
81 | return OVL_PATH_LOWER; | ||
82 | } | 78 | } |
79 | return type; | ||
83 | } | 80 | } |
84 | 81 | ||
85 | static struct dentry *ovl_upperdentry_dereference(struct ovl_entry *oe) | 82 | static struct dentry *ovl_upperdentry_dereference(struct ovl_entry *oe) |
@@ -101,7 +98,7 @@ enum ovl_path_type ovl_path_real(struct dentry *dentry, struct path *path) | |||
101 | 98 | ||
102 | enum ovl_path_type type = ovl_path_type(dentry); | 99 | enum ovl_path_type type = ovl_path_type(dentry); |
103 | 100 | ||
104 | if (type == OVL_PATH_LOWER) | 101 | if (!OVL_TYPE_UPPER(type)) |
105 | ovl_path_lower(dentry, path); | 102 | ovl_path_lower(dentry, path); |
106 | else | 103 | else |
107 | ovl_path_upper(dentry, path); | 104 | ovl_path_upper(dentry, path); |