Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98442
b: refs/heads/master
c: c8e7f44
h: refs/heads/master
v: v3
  • Loading branch information
Jan Blunck authored and Al Viro committed Jun 23, 2008
1 parent 86f9611 commit 43c024f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c70f84417429f41519be0197a1092a53c2201f47
refs/heads/master: c8e7f449b225ee6c87454ac069f0a041035c5140
11 changes: 5 additions & 6 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,15 +581,13 @@ static __always_inline int link_path_walk(const char *name, struct nameidata *nd
int result;

/* make sure the stuff we saved doesn't go away */
dget(save.dentry);
mntget(save.mnt);
path_get(&save);

result = __link_path_walk(name, nd);
if (result == -ESTALE) {
/* nd->path had been dropped */
nd->path = save;
dget(nd->path.dentry);
mntget(nd->path.mnt);
path_get(&nd->path);
nd->flags |= LOOKUP_REVAL;
result = __link_path_walk(name, nd);
}
Expand Down Expand Up @@ -1216,8 +1214,9 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
nd->flags = flags;
nd->depth = 0;

nd->path.mnt = mntget(mnt);
nd->path.dentry = dget(dentry);
nd->path.dentry = dentry;
nd->path.mnt = mnt;
path_get(&nd->path);

retval = path_walk(name, nd);
if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry &&
Expand Down
10 changes: 4 additions & 6 deletions trunk/fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,7 @@ struct file *create_write_pipe(void)
void free_write_pipe(struct file *f)
{
free_pipe_info(f->f_dentry->d_inode);
dput(f->f_path.dentry);
mntput(f->f_path.mnt);
path_put(&f->f_path);
put_filp(f);
}

Expand All @@ -1015,8 +1014,8 @@ struct file *create_read_pipe(struct file *wrf)
return ERR_PTR(-ENFILE);

/* Grab pipe from the writer */
f->f_path.mnt = mntget(wrf->f_path.mnt);
f->f_path.dentry = dget(wrf->f_path.dentry);
f->f_path = wrf->f_path;
path_get(&wrf->f_path);
f->f_mapping = wrf->f_path.dentry->d_inode->i_mapping;

f->f_pos = 0;
Expand Down Expand Up @@ -1068,8 +1067,7 @@ int do_pipe(int *fd)
err_fdr:
put_unused_fd(fdr);
err_read_pipe:
dput(fr->f_dentry);
mntput(fr->f_vfsmnt);
path_put(&fr->f_path);
put_filp(fr);
err_write_pipe:
free_write_pipe(fw);
Expand Down

0 comments on commit 43c024f

Please sign in to comment.