|
@@ -1546,6 +1546,7 @@ static int path_walk(const char *name, struct nameidata *nd)
|
|
/* nd->path had been dropped */
|
|
/* nd->path had been dropped */
|
|
current->total_link_count = 0;
|
|
current->total_link_count = 0;
|
|
nd->path = save;
|
|
nd->path = save;
|
|
|
|
+ nd->inode = save.dentry->d_inode;
|
|
path_get(&nd->path);
|
|
path_get(&nd->path);
|
|
nd->flags |= LOOKUP_REVAL;
|
|
nd->flags |= LOOKUP_REVAL;
|
|
result = link_path_walk(name, nd);
|
|
result = link_path_walk(name, nd);
|
|
@@ -2455,22 +2456,29 @@ struct file *do_filp_open(int dfd, const char *pathname,
|
|
/* !O_CREAT, simple open */
|
|
/* !O_CREAT, simple open */
|
|
error = do_path_lookup(dfd, pathname, flags, &nd);
|
|
error = do_path_lookup(dfd, pathname, flags, &nd);
|
|
if (unlikely(error))
|
|
if (unlikely(error))
|
|
- goto out_filp;
|
|
|
|
|
|
+ goto out_filp2;
|
|
error = -ELOOP;
|
|
error = -ELOOP;
|
|
if (!(nd.flags & LOOKUP_FOLLOW)) {
|
|
if (!(nd.flags & LOOKUP_FOLLOW)) {
|
|
if (nd.inode->i_op->follow_link)
|
|
if (nd.inode->i_op->follow_link)
|
|
- goto out_path;
|
|
|
|
|
|
+ goto out_path2;
|
|
}
|
|
}
|
|
error = -ENOTDIR;
|
|
error = -ENOTDIR;
|
|
if (nd.flags & LOOKUP_DIRECTORY) {
|
|
if (nd.flags & LOOKUP_DIRECTORY) {
|
|
if (!nd.inode->i_op->lookup)
|
|
if (!nd.inode->i_op->lookup)
|
|
- goto out_path;
|
|
|
|
|
|
+ goto out_path2;
|
|
}
|
|
}
|
|
audit_inode(pathname, nd.path.dentry);
|
|
audit_inode(pathname, nd.path.dentry);
|
|
filp = finish_open(&nd, open_flag, acc_mode);
|
|
filp = finish_open(&nd, open_flag, acc_mode);
|
|
|
|
+out2:
|
|
release_open_intent(&nd);
|
|
release_open_intent(&nd);
|
|
return filp;
|
|
return filp;
|
|
|
|
|
|
|
|
+out_path2:
|
|
|
|
+ path_put(&nd.path);
|
|
|
|
+out_filp2:
|
|
|
|
+ filp = ERR_PTR(error);
|
|
|
|
+ goto out2;
|
|
|
|
+
|
|
creat:
|
|
creat:
|
|
/* OK, have to create the file. Find the parent. */
|
|
/* OK, have to create the file. Find the parent. */
|
|
error = path_init_rcu(dfd, pathname,
|
|
error = path_init_rcu(dfd, pathname,
|