diff -u --recursive --new-file linux-2.5.33-rpccred/fs/exec.c linux-2.5.33-vfs1/fs/exec.c --- linux-2.5.33-rpccred/fs/exec.c Sun Sep 8 20:05:44 2002 +++ linux-2.5.33-vfs1/fs/exec.c Sun Sep 8 20:17:35 2002 @@ -123,7 +123,7 @@ if (error) goto exit; - file = dentry_open(nd.dentry, nd.mnt, O_RDONLY); + file = dentry_open(&nd, O_RDONLY); error = PTR_ERR(file); if (IS_ERR(file)) goto out; @@ -432,7 +432,7 @@ err = -EACCES; file = ERR_PTR(err); if (!err) { - file = dentry_open(nd.dentry, nd.mnt, O_RDONLY); + file = dentry_open(&nd, O_RDONLY); if (!IS_ERR(file)) { err = deny_write_access(file); if (err) { diff -u --recursive --new-file linux-2.5.33-rpccred/fs/namei.c linux-2.5.33-vfs1/fs/namei.c --- linux-2.5.33-rpccred/fs/namei.c Sun Sep 8 20:05:44 2002 +++ linux-2.5.33-vfs1/fs/namei.c Sun Sep 8 20:17:35 2002 @@ -267,6 +267,7 @@ { dput(nd->dentry); mntput(nd->mnt); + put_vfscred(nd->vfscred); } /* @@ -855,6 +856,7 @@ { nd->last_type = LAST_ROOT; /* if there are only slashes... */ nd->flags = flags; + nd->vfscred = get_current_vfscred(); if (*name=='/') { read_lock(¤t->fs->lock); if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) { diff -u --recursive --new-file linux-2.5.33-rpccred/fs/nfsctl.c linux-2.5.33-vfs1/fs/nfsctl.c --- linux-2.5.33-rpccred/fs/nfsctl.c Wed May 22 17:48:12 2002 +++ linux-2.5.33-vfs1/fs/nfsctl.c Sun Sep 8 20:17:35 2002 @@ -44,7 +44,7 @@ error = may_open(&nd, MAY_WRITE, FMODE_WRITE); if (!error) - return dentry_open(nd.dentry, nd.mnt, flags); + return dentry_open(&nd, flags); path_release(&nd); return ERR_PTR(error); diff -u --recursive --new-file linux-2.5.33-rpccred/fs/open.c linux-2.5.33-vfs1/fs/open.c --- linux-2.5.33-rpccred/fs/open.c Sun Sep 8 20:10:35 2002 +++ linux-2.5.33-vfs1/fs/open.c Sun Sep 8 20:17:35 2002 @@ -618,12 +618,12 @@ error = open_namei(filename, namei_flags, mode, &nd); if (!error) - return dentry_open(nd.dentry, nd.mnt, flags); + return dentry_open(&nd, flags); return ERR_PTR(error); } -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags) +struct file *dentry_open(struct nameidata *nd, int flags) { struct file * f; struct inode *inode; @@ -636,7 +636,7 @@ goto cleanup_dentry; f->f_flags = flags; f->f_mode = (flags+1) & O_ACCMODE; - inode = dentry->d_inode; + inode = nd->dentry->d_inode; if (f->f_mode & FMODE_WRITE) { error = get_write_access(inode); if (error) @@ -644,9 +644,9 @@ } f->f_ra.ra_pages = inode->i_mapping->backing_dev_info->ra_pages; - f->f_cred = get_current_vfscred(); - f->f_dentry = dentry; - f->f_vfsmnt = mnt; + f->f_cred = nd->vfscred; + f->f_dentry = nd->dentry; + f->f_vfsmnt = nd->mnt; f->f_pos = 0; f->f_op = fops_get(inode->i_fop); file_move(f, &inode->i_sb->s_files); @@ -681,8 +681,7 @@ cleanup_file: put_filp(f); cleanup_dentry: - dput(dentry); - mntput(mnt); + path_release(nd); return ERR_PTR(error); } diff -u --recursive --new-file linux-2.5.33-rpccred/include/linux/fs.h linux-2.5.33-vfs1/include/linux/fs.h --- linux-2.5.33-rpccred/include/linux/fs.h Sun Sep 8 20:10:35 2002 +++ linux-2.5.33-vfs1/include/linux/fs.h Sun Sep 8 20:17:35 2002 @@ -1069,7 +1069,7 @@ extern int do_truncate(struct dentry *, loff_t start); extern struct file *filp_open(const char *, int, int); -extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); +extern struct file * dentry_open(struct nameidata *, int); extern int filp_close(struct file *, fl_owner_t id); extern char * getname(const char *); diff -u --recursive --new-file linux-2.5.33-rpccred/include/linux/namei.h linux-2.5.33-vfs1/include/linux/namei.h --- linux-2.5.33-rpccred/include/linux/namei.h Tue Jun 18 20:54:38 2002 +++ linux-2.5.33-vfs1/include/linux/namei.h Sun Sep 8 20:17:35 2002 @@ -13,6 +13,7 @@ int last_type; struct dentry *old_dentry; struct vfsmount *old_mnt; + struct vfs_cred *vfscred; }; /*