[Devel] [PATCH rh7] fs: drop LOOKUP_STRICT

Vladimir Davydov vdavydov at parallels.com
Sun Jun 21 08:38:16 PDT 2015


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 b75c26dea6c3..bf45504e524f 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 fb943ae1a1b6..8e47bc7a1665 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
-- 
2.1.4




More information about the Devel mailing list