ovl: cleanup setting OVL_INDEX
authorVivek Goyal <vgoyal@redhat.com>
Tue, 20 Mar 2018 20:35:40 +0000 (16:35 -0400)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 12 Apr 2018 10:04:49 +0000 (12:04 +0200)
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/export.c
fs/overlayfs/inode.c
fs/overlayfs/namei.c

index ed73e363c7b1603ef4e825cf74baeac1448c37f8..bb290cd1e727c6edfe1ba366b2aa85ecdd05bbdd 100644 (file)
@@ -311,9 +311,6 @@ static struct dentry *ovl_obtain_alias(struct super_block *sb,
                return ERR_CAST(inode);
        }
 
-       if (index)
-               ovl_set_flag(OVL_INDEX, inode);
-
        dentry = d_find_any_alias(inode);
        if (!dentry) {
                dentry = d_alloc_anon(inode->i_sb);
index 1d75b2e96c964f8567e02dba26a3d3d0e4f0105d..b3be0cfd4c92d93c61a42f101eeae6d05fc76e62 100644 (file)
@@ -770,6 +770,9 @@ struct inode *ovl_get_inode(struct super_block *sb, struct dentry *upperdentry,
        if (upperdentry && ovl_is_impuredir(upperdentry))
                ovl_set_flag(OVL_IMPURE, inode);
 
+       if (index)
+               ovl_set_flag(OVL_INDEX, inode);
+
        /* Check for non-merge dir that may have whiteouts */
        if (is_dir) {
                if (((upperdentry && lowerdentry) || numlower > 1) ||
index 0a26b76590d56502b43335167e2df86a687c613d..72230b759b58a29f45ebd1808a5b1c81ec27525b 100644 (file)
@@ -1007,8 +1007,6 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
                        goto out_free_oe;
 
                OVL_I(inode)->redirect = upperredirect;
-               if (index)
-                       ovl_set_flag(OVL_INDEX, inode);
        }
 
        revert_creds(old_cred);