Loading fs/overlayfs/dir.c +3 −6 Original line number Diff line number Diff line Loading @@ -803,10 +803,7 @@ static int ovl_rename(struct inode *olddir, struct dentry *old, if (!overwrite && OVL_TYPE_MERGE_OR_LOWER(new_type) && new_is_dir) goto out; } else { if (ovl_dentry_is_opaque(new)) new_type = __OVL_PATH_UPPER; else new_type = __OVL_PATH_UPPER | __OVL_PATH_PURE; } err = ovl_want_write(old); Loading @@ -826,8 +823,8 @@ static int ovl_rename(struct inode *olddir, struct dentry *old, goto out_drop_write; } old_opaque = !OVL_TYPE_PURE_UPPER(old_type); new_opaque = !OVL_TYPE_PURE_UPPER(new_type); old_opaque = ovl_dentry_is_opaque(old); new_opaque = ovl_dentry_is_opaque(new); old_cred = ovl_override_creds(old->d_sb); Loading fs/overlayfs/overlayfs.h +2 −4 Original line number Diff line number Diff line Loading @@ -12,14 +12,12 @@ struct ovl_entry; enum ovl_path_type { __OVL_PATH_PURE = (1 << 0), __OVL_PATH_UPPER = (1 << 1), __OVL_PATH_MERGE = (1 << 2), __OVL_PATH_UPPER = (1 << 0), __OVL_PATH_MERGE = (1 << 1), }; #define OVL_TYPE_UPPER(type) ((type) & __OVL_PATH_UPPER) #define OVL_TYPE_MERGE(type) ((type) & __OVL_PATH_MERGE) #define OVL_TYPE_PURE_UPPER(type) ((type) & __OVL_PATH_PURE) #define OVL_TYPE_MERGE_OR_LOWER(type) \ (OVL_TYPE_MERGE(type) || !OVL_TYPE_UPPER(type)) Loading fs/overlayfs/super.c +1 −3 Original line number Diff line number Diff line Loading @@ -80,12 +80,10 @@ enum ovl_path_type ovl_path_type(struct dentry *dentry) /* * Non-dir dentry can hold lower dentry from previous * location. Its purity depends only on opaque flag. * location. */ if (oe->numlower && S_ISDIR(dentry->d_inode->i_mode)) type |= __OVL_PATH_MERGE; else if (!oe->opaque) type |= __OVL_PATH_PURE; } else { if (oe->numlower > 1) type |= __OVL_PATH_MERGE; Loading Loading
fs/overlayfs/dir.c +3 −6 Original line number Diff line number Diff line Loading @@ -803,10 +803,7 @@ static int ovl_rename(struct inode *olddir, struct dentry *old, if (!overwrite && OVL_TYPE_MERGE_OR_LOWER(new_type) && new_is_dir) goto out; } else { if (ovl_dentry_is_opaque(new)) new_type = __OVL_PATH_UPPER; else new_type = __OVL_PATH_UPPER | __OVL_PATH_PURE; } err = ovl_want_write(old); Loading @@ -826,8 +823,8 @@ static int ovl_rename(struct inode *olddir, struct dentry *old, goto out_drop_write; } old_opaque = !OVL_TYPE_PURE_UPPER(old_type); new_opaque = !OVL_TYPE_PURE_UPPER(new_type); old_opaque = ovl_dentry_is_opaque(old); new_opaque = ovl_dentry_is_opaque(new); old_cred = ovl_override_creds(old->d_sb); Loading
fs/overlayfs/overlayfs.h +2 −4 Original line number Diff line number Diff line Loading @@ -12,14 +12,12 @@ struct ovl_entry; enum ovl_path_type { __OVL_PATH_PURE = (1 << 0), __OVL_PATH_UPPER = (1 << 1), __OVL_PATH_MERGE = (1 << 2), __OVL_PATH_UPPER = (1 << 0), __OVL_PATH_MERGE = (1 << 1), }; #define OVL_TYPE_UPPER(type) ((type) & __OVL_PATH_UPPER) #define OVL_TYPE_MERGE(type) ((type) & __OVL_PATH_MERGE) #define OVL_TYPE_PURE_UPPER(type) ((type) & __OVL_PATH_PURE) #define OVL_TYPE_MERGE_OR_LOWER(type) \ (OVL_TYPE_MERGE(type) || !OVL_TYPE_UPPER(type)) Loading
fs/overlayfs/super.c +1 −3 Original line number Diff line number Diff line Loading @@ -80,12 +80,10 @@ enum ovl_path_type ovl_path_type(struct dentry *dentry) /* * Non-dir dentry can hold lower dentry from previous * location. Its purity depends only on opaque flag. * location. */ if (oe->numlower && S_ISDIR(dentry->d_inode->i_mode)) type |= __OVL_PATH_MERGE; else if (!oe->opaque) type |= __OVL_PATH_PURE; } else { if (oe->numlower > 1) type |= __OVL_PATH_MERGE; Loading