[Devel] [PATCH RHEL7 COMMIT] ve/fs: drop LOOKUP_STRICT

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jun 22 05:20:00 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.15
------>
commit 2613cdaf6204c8e55def1c22759271ac938a19a1
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Mon Jun 22 16:20:00 2015 +0400

    ve/fs: drop LOOKUP_STRICT
    
    In RH6 LOOKUP_STRICT means "do not follow symlinks or mounts". Initially
    this was introduced for the sake of vefs, which was dropped in RH7.
    However, it was also used for pfcache lookups. The latter looks
    meaningless, because pfcache shouldn't have symlinks or submounts in it,
    but even if it does, it pfcache lookup w/o LOOKUP_STRICT won't lead to
    anything bad. So instead of porting LOOKUP_STRICT logic, let's just drop
    it.
    
    It's worth mentioning that LOOKUP_STRICT currently coincides with
    LOOKUP_ROOT. It does not lead to a disaster, because vfs_path_lookup,
    which we pass LOOKUP_STRICT to, sets LOOKUP_ROOT in any case.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 fs/ext4/pfcache.c     | 4 ++--
 include/linux/namei.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/pfcache.c b/fs/ext4/pfcache.c
index b75c26d..bf45504 100644
--- a/fs/ext4/pfcache.c
+++ b/fs/ext4/pfcache.c
@@ -67,7 +67,7 @@ int ext4_open_pfcache(struct inode *inode)
 	 * Here we disable lockdep to avoid false-positive reports.
 	 */
 	lockdep_off();
-	ret = vfs_path_lookup(root.dentry, root.mnt, name, LOOKUP_STRICT, &path);
+	ret = vfs_path_lookup(root.dentry, root.mnt, name, 0, &path);
 	lockdep_on();
 	revert_creds(cur_cred);
 	path_put(&root);
@@ -175,7 +175,7 @@ int ext4_relink_pfcache(struct super_block *sb, char *new_root, bool new_sb)
 			pfcache_path(inode, name);
 			cur_cred = override_creds(&init_cred);
 			err = vfs_path_lookup(root.dentry, root.mnt,
-					name, LOOKUP_STRICT, &path);
+					name, 0, &path);
 			revert_creds(cur_cred);
 			if (err) {
 				path.mnt = NULL;
diff --git a/include/linux/namei.h b/include/linux/namei.h
index fb943ae..8e47bc7 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -51,7 +51,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
 #define LOOKUP_CREATE		0x0200
 #define LOOKUP_EXCL		0x0400
 #define LOOKUP_RENAME_TARGET	0x0800
-#define LOOKUP_STRICT		0x2000	/* no symlinks or other filesystems */
 
 #define LOOKUP_JUMPED		0x1000
 #define LOOKUP_ROOT		0x2000



More information about the Devel mailing list