summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-10 14:26:00 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-10 14:26:00 -0800
commit33175d84ee3fa29991adb80513683e010769e807 (patch)
tree3731f61cf82451b6892cf1368701e57e35d92908 /fs/namei.c
parentc5908939b2738bafe1b309bc2465cb9f2e6184c5 (diff)
parent6dfbd87a20a737641ef228230c77f4262434fa24 (diff)
downloadlinux-33175d84ee3fa29991adb80513683e010769e807.tar.gz
linux-33175d84ee3fa29991adb80513683e010769e807.tar.bz2
linux-33175d84ee3fa29991adb80513683e010769e807.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/bnx2x/bnx2x_cmn.c
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 0087cf9c2c6b..a4689eb2df28 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1546,6 +1546,7 @@ static int path_walk(const char *name, struct nameidata *nd)
/* nd->path had been dropped */
current->total_link_count = 0;
nd->path = save;
+ nd->inode = save.dentry->d_inode;
path_get(&nd->path);
nd->flags |= LOOKUP_REVAL;
result = link_path_walk(name, nd);
@@ -2455,22 +2456,29 @@ struct file *do_filp_open(int dfd, const char *pathname,
/* !O_CREAT, simple open */
error = do_path_lookup(dfd, pathname, flags, &nd);
if (unlikely(error))
- goto out_filp;
+ goto out_filp2;
error = -ELOOP;
if (!(nd.flags & LOOKUP_FOLLOW)) {
if (nd.inode->i_op->follow_link)
- goto out_path;
+ goto out_path2;
}
error = -ENOTDIR;
if (nd.flags & LOOKUP_DIRECTORY) {
if (!nd.inode->i_op->lookup)
- goto out_path;
+ goto out_path2;
}
audit_inode(pathname, nd.path.dentry);
filp = finish_open(&nd, open_flag, acc_mode);
+out2:
release_open_intent(&nd);
return filp;
+out_path2:
+ path_put(&nd.path);
+out_filp2:
+ filp = ERR_PTR(error);
+ goto out2;
+
creat:
/* OK, have to create the file. Find the parent. */
error = path_init_rcu(dfd, pathname,