浏览代码

VFS: Make link_path_walk set LOOKUP_CONTINUE before calling permission().

 This will allow nfs_permission() to perform additional optimizations when
 walking the path, by folding the ACCESS(MAY_EXEC) call on the directory
 into the lookup revalidation.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Trond Myklebust 19 年之前
父节点
当前提交
cdce5d6b94
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/namei.c

+ 1 - 1
fs/namei.c

@@ -763,6 +763,7 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
 		struct qstr this;
 		struct qstr this;
 		unsigned int c;
 		unsigned int c;
 
 
+		nd->flags |= LOOKUP_CONTINUE;
 		err = exec_permission_lite(inode, nd);
 		err = exec_permission_lite(inode, nd);
 		if (err == -EAGAIN) { 
 		if (err == -EAGAIN) { 
 			err = permission(inode, MAY_EXEC, nd);
 			err = permission(inode, MAY_EXEC, nd);
@@ -815,7 +816,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
 			if (err < 0)
 			if (err < 0)
 				break;
 				break;
 		}
 		}
-		nd->flags |= LOOKUP_CONTINUE;
 		/* This does the actual lookups.. */
 		/* This does the actual lookups.. */
 		err = do_lookup(nd, &this, &next);
 		err = do_lookup(nd, &this, &next);
 		if (err)
 		if (err)