-Index: linux-2.6.3-20/fs/exec.c
+Index: linux-2.6.5-12.1/fs/exec.c
===================================================================
---- linux-2.6.3-20.orig/fs/exec.c 2004-03-05 02:07:04.000000000 -0800
-+++ linux-2.6.3-20/fs/exec.c 2004-03-08 14:23:40.000000000 -0800
-@@ -121,8 +121,11 @@
- struct file * file;
+--- linux-2.6.5-12.1.orig/fs/exec.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/fs/exec.c 2004-05-25 17:32:14.038494200 +0300
+@@ -125,9 +125,10 @@
struct nameidata nd;
int error;
-+ intent_init(&nd.intent, IT_OPEN);
- nd.intent.open.flags = FMODE_READ;
-+ error = user_path_walk_it(library, &nd);
-+
-+ nd.intent.it_flags = O_RDONLY;
- error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
- if (error)
++ intent_init(&nd.intent, IT_OPEN);
+
+- FSHOOK_BEGIN_USER_WALK(open,
++ nd.intent.it_flags = FMODE_READ;
++ FSHOOK_BEGIN_USER_WALK_IT(open,
+ error,
+ library,
+ LOOKUP_FOLLOW|LOOKUP_OPEN,
+@@ -144,7 +145,7 @@
goto out;
-@@ -135,7 +138,7 @@
- if (error)
- goto exit;
+ }
- file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
+ file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent);
error = PTR_ERR(file);
if (IS_ERR(file))
goto out;
-@@ -475,8 +478,9 @@
- int err;
- struct file *file;
+@@ -495,8 +496,9 @@
+
+ FSHOOK_BEGIN(open, err, .filename = name, .flags = O_RDONLY)
- nd.intent.open.flags = FMODE_READ;
- err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
+ intent_init(&nd.intent, IT_OPEN);
-+ nd.intent.it_flags = O_RDONLY;
++ nd.intent.it_flags = FMODE_READ;
+ err = path_lookup(name, LOOKUP_FOLLOW, &nd);
file = ERR_PTR(err);
if (!err) {
-@@ -489,7 +493,7 @@
+@@ -509,7 +511,7 @@
err = -EACCES;
file = ERR_PTR(err);
if (!err) {
if (!IS_ERR(file)) {
err = deny_write_access(file);
if (err) {
-Index: linux-2.6.3-20/fs/namei.c
+Index: linux-2.6.5-12.1/fs/namei.c
===================================================================
---- linux-2.6.3-20.orig/fs/namei.c 2004-03-05 02:07:04.000000000 -0800
-+++ linux-2.6.3-20/fs/namei.c 2004-03-08 14:32:24.000000000 -0800
-@@ -269,8 +269,19 @@
+--- linux-2.6.5-12.1.orig/fs/namei.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/fs/namei.c 2004-05-25 17:32:14.040493896 +0300
+@@ -270,8 +270,19 @@
return 0;
}
dput(nd->dentry);
mntput(nd->mnt);
}
-@@ -347,7 +358,10 @@
+@@ -348,7 +359,10 @@
{
struct dentry * result;
struct inode *dir = parent->d_inode;
down(&dir->i_sem);
/*
* First re-do the cached lookup just in case it was created
-@@ -386,7 +400,10 @@
+@@ -387,7 +401,10 @@
if (result->d_op && result->d_op->d_revalidate) {
if (!result->d_op->d_revalidate(result, nd) && !d_invalidate(result)) {
dput(result);
}
}
return result;
-@@ -563,6 +580,31 @@
+@@ -564,6 +581,33 @@
return PTR_ERR(dentry);
}
+ if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC,nd)))
+ return err;
+ new = real_lookup(dentry->d_parent, &dentry->d_name, nd);
++ if (IS_ERR(new))
++ return PTR_ERR(new);
+ d_invalidate(dentry);
+ dput(dentry);
+ nd->dentry = dentry = new;
/*
* Name resolution.
*
-@@ -663,7 +705,9 @@
+@@ -664,7 +708,9 @@
if (inode->i_op->follow_link) {
mntget(next.mnt);
dput(next.dentry);
mntput(next.mnt);
if (err)
-@@ -702,6 +746,11 @@
+@@ -703,14 +749,29 @@
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
+ nd->flags |= LOOKUP_LAST;
+ err = revalidate_special(nd);
+ nd->flags &= ~LOOKUP_LAST;
-+ if (err)
++ if (err)
+ break;
goto return_reval;
}
++
++ if (err) {
++ if (!nd->dentry->d_inode)
++ err = -ENOENT;
++
++ goto return_err;
++ }
++
if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
-@@ -709,7 +758,9 @@
+ err = nd->dentry->d_op->d_hash(nd->dentry, &this);
if (err < 0)
break;
}
if (err)
break;
follow_mount(&next.mnt, &next.dentry);
-@@ -935,7 +986,7 @@
+@@ -936,7 +997,7 @@
}
/* SMP-safe */
{
unsigned long hash;
struct qstr this;
-@@ -955,11 +1006,16 @@
+@@ -956,11 +1017,16 @@
}
this.hash = end_name_hash(hash);
/*
* namei()
*
-@@ -971,7 +1027,7 @@
+@@ -972,7 +1038,8 @@
* that namei follows links, while lnamei does not.
* SMP-safe
*/
--int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
-+int fastcall __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)
+-int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd, const char **pname)
++int fastcall __user_walk_it(const char __user *name, unsigned flags,
++ struct nameidata *nd, const char **pname)
{
char *tmp = getname(name);
int err = PTR_ERR(tmp);
-@@ -983,6 +1039,12 @@
+@@ -987,6 +1054,13 @@
return err;
}
-+int __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
++int __user_walk(const char __user *name, unsigned flags,
++ struct nameidata *nd, const char **pname)
+{
+ intent_init(&nd->intent, IT_LOOKUP);
-+ return __user_walk_it(name, flags, nd);
++ return __user_walk_it(name, flags, nd, pname);
+}
+
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
-@@ -1255,8 +1317,8 @@
+@@ -1259,8 +1333,8 @@
acc_mode |= MAY_APPEND;
/* Fill in the open() intent data */
/*
* The simplest case - just a plain lookup.
-@@ -1271,6 +1333,7 @@
+@@ -1275,6 +1349,7 @@
/*
* Create - we need to know the parent.
*/
error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
if (error)
return error;
-@@ -1287,7 +1350,9 @@
+@@ -1291,7 +1366,9 @@
dir = nd->dentry;
nd->flags &= ~LOOKUP_PARENT;
down(&dir->d_inode->i_sem);
do_last:
error = PTR_ERR(dentry);
-@@ -1392,7 +1457,9 @@
+@@ -1396,7 +1473,9 @@
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
putname(nd->last.name);
goto do_last;
}
-@@ -2154,7 +2221,9 @@
+@@ -2196,7 +2275,9 @@
__vfs_follow_link(struct nameidata *nd, const char *link)
{
int res = 0;
if (IS_ERR(link))
goto fail;
-@@ -2164,6 +2233,10 @@
+@@ -2206,6 +2287,10 @@
/* weird __emul_prefix() stuff did it */
goto out;
}
res = link_path_walk(link, nd);
out:
if (current->link_count || res || nd->last_type!=LAST_NORM)
-Index: linux-2.6.3-20/fs/namespace.c
+Index: linux-2.6.5-12.1/fs/namespace.c
===================================================================
---- linux-2.6.3-20.orig/fs/namespace.c 2004-03-05 02:07:04.000000000 -0800
-+++ linux-2.6.3-20/fs/namespace.c 2004-03-08 14:23:40.000000000 -0800
-@@ -744,6 +744,7 @@
+--- linux-2.6.5-12.1.orig/fs/namespace.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/fs/namespace.c 2004-05-25 17:33:44.385759328 +0300
+@@ -108,6 +108,7 @@
+
+ static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
+ {
++ memset(old_nd, 0, sizeof(*old_nd));
+ old_nd->dentry = mnt->mnt_mountpoint;
+ old_nd->mnt = mnt->mnt_parent;
+ mnt->mnt_parent = mnt;
+@@ -533,6 +534,8 @@
+ return err;
+ if (!old_name || !*old_name)
+ return -EINVAL;
++
++ intent_init(&old_nd.intent, IT_LOOKUP);
+ err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
+ if (err)
+ return err;
+@@ -601,6 +604,7 @@
+ return -EPERM;
+ if (!old_name || !*old_name)
+ return -EINVAL;
++ intent_init(&old_nd.intent, IT_LOOKUP);
+ err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
+ if (err)
+ return err;
+@@ -750,6 +754,7 @@
int retval = 0;
int mnt_flags = 0;
/* Discard magic */
if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
flags &= ~MS_MGC_MSK;
-Index: linux-2.6.3-20/fs/open.c
+Index: linux-2.6.5-12.1/fs/open.c
===================================================================
---- linux-2.6.3-20.orig/fs/open.c 2004-03-05 02:07:04.000000000 -0800
-+++ linux-2.6.3-20/fs/open.c 2004-03-08 14:23:40.000000000 -0800
-@@ -202,7 +202,7 @@
+--- linux-2.6.5-12.1.orig/fs/open.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/fs/open.c 2004-05-25 17:32:14.042493592 +0300
+@@ -227,12 +227,12 @@
struct nameidata nd;
struct inode * inode;
int error;
error = -EINVAL;
if (length < 0) /* sorry, but loff_t says... */
goto out;
-@@ -461,6 +461,7 @@
+
+- FSHOOK_BEGIN_USER_PATH_WALK(truncate, error, path, nd, filename, .length = length)
++ FSHOOK_BEGIN_USER_PATH_WALK_IT(truncate, error, path, nd, filename, .length = length)
+
+ inode = nd.dentry->d_inode;
+
+@@ -466,6 +466,7 @@
int old_fsuid, old_fsgid;
kernel_cap_t old_cap;
int res;
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL;
-@@ -492,6 +493,7 @@
+@@ -490,7 +491,7 @@
+ else
+ current->cap_effective = current->cap_permitted;
+
+- FSHOOK_BEGIN_USER_WALK(access,
++ FSHOOK_BEGIN_USER_WALK_IT(access,
+ res,
+ filename,
+ LOOKUP_FOLLOW|LOOKUP_ACCESS,
+@@ -506,6 +507,7 @@
if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
&& !special_file(nd.dentry->d_inode->i_mode))
res = -EROFS;
+
path_release(&nd);
- }
-@@ -506,6 +508,7 @@
+ FSHOOK_END_USER_WALK(access, res, path)
+@@ -545,11 +547,13 @@
+
+ asmlinkage long sys_fchdir(unsigned int fd)
{
- struct nameidata nd;
++ struct nameidata nd;
+ struct file *file;
+ struct dentry *dentry;
+ struct inode *inode;
+ struct vfsmount *mnt;
int error;
+ intent_init(&nd.intent, IT_GETATTR);
- error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
- if (error)
-@@ -557,6 +560,7 @@
+ FSHOOK_BEGIN(fchdir, error, .fd = fd)
+
+@@ -582,8 +586,9 @@
{
struct nameidata nd;
int error;
+ intent_init(&nd.intent, IT_GETATTR);
- error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
- if (error)
-@@ -629,7 +633,7 @@
+- FSHOOK_BEGIN_USER_WALK(chroot,
++ FSHOOK_BEGIN_USER_WALK_IT(chroot,
+ error,
+ filename,
+ LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT,
+@@ -670,7 +675,7 @@
error = -EROFS;
if (IS_RDONLY(inode))
goto dput_and_out;
error = -EPERM;
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
goto dput_and_out;
-@@ -737,27 +741,8 @@
+@@ -804,27 +809,8 @@
* for the internal routines (ie open_namei()/follow_link() etc). 00 is
* used by symlinks.
*/
{
struct file * f;
struct inode *inode;
-@@ -769,6 +754,7 @@
+@@ -836,6 +822,7 @@
goto cleanup_dentry;
f->f_flags = flags;
f->f_mode = (flags+1) & O_ACCMODE;
inode = dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
error = get_write_access(inode);
-@@ -788,6 +774,7 @@
+@@ -855,6 +842,7 @@
error = f->f_op->open(inode,f);
if (error)
goto cleanup_all;
}
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-@@ -812,6 +799,7 @@
+@@ -879,6 +867,7 @@
cleanup_file:
put_filp(f);
cleanup_dentry:
dput(dentry);
mntput(mnt);
return ERR_PTR(error);
-@@ -819,6 +807,36 @@
+@@ -886,6 +875,36 @@
EXPORT_SYMBOL(dentry_open);
/*
* Find an empty file descriptor entry, and mark it busy.
*/
-Index: linux-2.6.3-20/fs/stat.c
+Index: linux-2.6.5-12.1/fs/stat.c
===================================================================
---- linux-2.6.3-20.orig/fs/stat.c 2004-03-05 02:07:04.000000000 -0800
-+++ linux-2.6.3-20/fs/stat.c 2004-03-08 14:23:40.000000000 -0800
-@@ -36,7 +36,7 @@
+--- linux-2.6.5-12.1.orig/fs/stat.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/fs/stat.c 2004-05-25 17:32:14.042493592 +0300
+@@ -37,7 +37,7 @@
EXPORT_SYMBOL(generic_fillattr);
{
struct inode *inode = dentry->d_inode;
int retval;
-@@ -45,6 +45,8 @@
+@@ -46,6 +46,8 @@
if (retval)
return retval;
if (inode->i_op->getattr)
return inode->i_op->getattr(mnt, dentry, stat);
-@@ -61,14 +63,20 @@
+@@ -62,14 +64,20 @@
EXPORT_SYMBOL(vfs_getattr);
int error;
+ intent_init(&nd.intent, IT_GETATTR);
-- error = user_path_walk(name, &nd);
-+ error = user_path_walk_it(name, &nd);
- if (!error) {
+- FSHOOK_BEGIN_USER_PATH_WALK(stat, error, name, nd, path, .link = false)
++ FSHOOK_BEGIN_USER_PATH_WALK_IT(stat, error, name, nd, path, .link = false)
+
- error = vfs_getattr(nd.mnt, nd.dentry, stat);
+ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
path_release(&nd);
- }
- return error;
-@@ -80,10 +88,11 @@
+
+ FSHOOK_END_USER_WALK(stat, error, path)
+@@ -83,10 +91,11 @@
{
struct nameidata nd;
int error;
+ intent_init(&nd.intent, IT_GETATTR);
-- error = user_path_walk_link(name, &nd);
-+ error = user_path_walk_link_it(name, &nd);
- if (!error) {
+- FSHOOK_BEGIN_USER_PATH_WALK_LINK(stat, error, name, nd, path, .link = true)
++ FSHOOK_BEGIN_USER_PATH_WALK_LINK_IT(stat, error, name, nd, path, .link = true)
+
- error = vfs_getattr(nd.mnt, nd.dentry, stat);
+ error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
path_release(&nd);
- }
- return error;
-@@ -95,9 +104,12 @@
+
+ FSHOOK_END_USER_WALK(stat, error, path)
+@@ -99,6 +108,8 @@
+ int vfs_fstat(unsigned int fd, struct kstat *stat)
{
- struct file *f = fget(fd);
- int error = -EBADF;
+ int error;
+ struct nameidata nd;
+ intent_init(&nd.intent, IT_GETATTR);
+ FSHOOK_BEGIN(fstat, error, .fd = fd)
+
+@@ -106,7 +117,8 @@
+
+ error = -EBADF;
if (f) {
- error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
+ error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
+ intent_release(&nd.intent);
fput(f);
}
- return error;
-Index: linux-2.6.3-20/fs/nfs/dir.c
+
+Index: linux-2.6.5-12.1/fs/nfs/dir.c
===================================================================
---- linux-2.6.3-20.orig/fs/nfs/dir.c 2004-03-05 02:07:03.000000000 -0800
-+++ linux-2.6.3-20/fs/nfs/dir.c 2004-03-08 14:23:40.000000000 -0800
-@@ -681,7 +681,7 @@
+--- linux-2.6.5-12.1.orig/fs/nfs/dir.c 2004-05-10 19:21:53.000000000 +0300
++++ linux-2.6.5-12.1/fs/nfs/dir.c 2004-05-25 17:32:14.043493440 +0300
+@@ -709,7 +709,7 @@
return 0;
if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
return 0;
}
static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
-@@ -972,7 +972,7 @@
+@@ -1026,7 +1026,7 @@
attr.ia_valid = ATTR_MODE;
if (nd && (nd->flags & LOOKUP_CREATE))
/*
* The 0 argument passed into the create function should one day
-Index: linux-2.6.3-20/fs/inode.c
+Index: linux-2.6.5-12.1/fs/inode.c
===================================================================
---- linux-2.6.3-20.orig/fs/inode.c 2004-03-05 02:07:04.000000000 -0800
-+++ linux-2.6.3-20/fs/inode.c 2004-03-08 14:23:40.000000000 -0800
-@@ -223,6 +223,7 @@
+--- linux-2.6.5-12.1.orig/fs/inode.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/fs/inode.c 2004-05-25 17:32:14.044493288 +0300
+@@ -221,6 +221,7 @@
inodes_stat.nr_unused--;
}
/**
* clear_inode - clear an inode
* @inode: inode to clear
-Index: linux-2.6.3-20/fs/super.c
+Index: linux-2.6.5-12.1/fs/super.c
===================================================================
---- linux-2.6.3-20.orig/fs/super.c 2004-03-05 02:07:04.000000000 -0800
-+++ linux-2.6.3-20/fs/super.c 2004-03-08 14:23:40.000000000 -0800
-@@ -841,6 +841,8 @@
+--- linux-2.6.5-12.1.orig/fs/super.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/fs/super.c 2004-05-25 17:32:14.045493136 +0300
+@@ -789,6 +789,8 @@
return (struct vfsmount *)sb;
}
struct vfsmount *kern_mount(struct file_system_type *type)
{
return do_kern_mount(type->name, 0, type->name, NULL);
-Index: linux-2.6.3-20/include/linux/dcache.h
+Index: linux-2.6.5-12.1/include/linux/dcache.h
===================================================================
---- linux-2.6.3-20.orig/include/linux/dcache.h 2004-03-05 02:07:17.000000000 -0800
-+++ linux-2.6.3-20/include/linux/dcache.h 2004-03-08 14:23:40.000000000 -0800
+--- linux-2.6.5-12.1.orig/include/linux/dcache.h 2004-04-04 06:38:24.000000000 +0300
++++ linux-2.6.5-12.1/include/linux/dcache.h 2004-05-25 17:32:14.045493136 +0300
@@ -4,6 +4,7 @@
#ifdef __KERNEL__
struct dentry_stat_t {
int nr_dentry;
int nr_unused;
-Index: linux-2.6.3-20/include/linux/fs.h
+Index: linux-2.6.5-12.1/include/linux/fs.h
===================================================================
---- linux-2.6.3-20.orig/include/linux/fs.h 2004-03-05 02:07:17.000000000 -0800
-+++ linux-2.6.3-20/include/linux/fs.h 2004-03-08 14:23:41.000000000 -0800
-@@ -243,6 +243,8 @@
+--- linux-2.6.5-12.1.orig/include/linux/fs.h 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/include/linux/fs.h 2004-05-25 17:32:14.046492984 +0300
+@@ -250,6 +250,8 @@
#define ATTR_ATTR_FLAG 1024
#define ATTR_KILL_SUID 2048
#define ATTR_KILL_SGID 4096
/*
* This is the Inode Attributes structure, used for notify_change(). It
-@@ -409,6 +411,7 @@
+@@ -423,6 +425,7 @@
struct block_device *i_bdev;
struct cdev *i_cdev;
int i_cindex;
unsigned long i_dnotify_mask; /* Directory notify events */
struct dnotify_struct *i_dnotify; /* for directory notifications */
-@@ -541,6 +544,7 @@
+@@ -556,6 +559,7 @@
spinlock_t f_ep_lock;
#endif /* #ifdef CONFIG_EPOLL */
struct address_space *f_mapping;
};
extern spinlock_t files_lock;
#define file_list_lock() spin_lock(&files_lock);
-@@ -846,7 +850,9 @@
+@@ -886,7 +890,9 @@
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int, struct nameidata *);
int (*setattr) (struct dentry *, struct iattr *);
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
ssize_t (*listxattr) (struct dentry *, char *, size_t);
-@@ -1062,6 +1068,7 @@
+@@ -1114,6 +1120,7 @@
extern int unregister_filesystem(struct file_system_type *);
extern struct vfsmount *kern_mount(struct file_system_type *);
extern int may_umount(struct vfsmount *);
extern long do_mount(char *, char *, char *, unsigned long, void *);
extern int vfs_statfs(struct super_block *, struct kstatfs *);
-@@ -1126,6 +1133,7 @@
+@@ -1178,6 +1185,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 int filp_close(struct file *, fl_owner_t id);
extern char * getname(const char __user *);
-Index: linux-2.6.3-20/include/linux/namei.h
+Index: linux-2.6.5-12.1/include/linux/namei.h
===================================================================
---- linux-2.6.3-20.orig/include/linux/namei.h 2004-03-05 02:07:18.000000000 -0800
-+++ linux-2.6.3-20/include/linux/namei.h 2004-03-08 14:23:41.000000000 -0800
+--- linux-2.6.5-12.1.orig/include/linux/namei.h 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/include/linux/namei.h 2004-05-25 17:32:14.047492832 +0300
@@ -2,25 +2,55 @@
#define _LINUX_NAMEI_H
@@ -49,6 +82,12 @@
#define LOOKUP_ACCESS (0x0400)
- extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
-+extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd));
+ extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *, const char **));
++extern int FASTCALL(__user_walk_it(const char __user *, unsigned, struct nameidata *, const char **));
+#define user_path_walk_it(name,nd) \
-+ __user_walk_it(name, LOOKUP_FOLLOW, nd)
++ __user_walk_it(name, LOOKUP_FOLLOW, nd, 0)
+#define user_path_walk_link_it(name,nd) \
-+ __user_walk_it(name, 0, nd)
++ __user_walk_it(name, 0, nd, 0)
+extern void intent_release(struct lookup_intent *);
#define user_path_walk(name,nd) \
- __user_walk(name, LOOKUP_FOLLOW, nd)
+ __user_walk(name, LOOKUP_FOLLOW, nd, 0)
#define user_path_walk_link(name,nd) \
@@ -60,7 +99,6 @@
extern int follow_down(struct vfsmount **, struct dentry **);
extern int follow_up(struct vfsmount **, struct dentry **);
-Index: linux-2.6.3-20/kernel/exit.c
+Index: linux-2.6.5-12.1/kernel/exit.c
===================================================================
---- linux-2.6.3-20.orig/kernel/exit.c 2004-03-05 02:07:17.000000000 -0800
-+++ linux-2.6.3-20/kernel/exit.c 2004-03-08 14:23:41.000000000 -0800
-@@ -258,6 +258,8 @@
+--- linux-2.6.5-12.1.orig/kernel/exit.c 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/kernel/exit.c 2004-05-25 17:32:14.047492832 +0300
+@@ -260,6 +260,8 @@
write_unlock_irq(&tasklist_lock);
}
void __set_special_pids(pid_t session, pid_t pgrp)
{
struct task_struct *curr = current;
-@@ -427,6 +429,8 @@
+@@ -429,6 +431,8 @@
__exit_files(tsk);
}
static inline void __put_fs_struct(struct fs_struct *fs)
{
/* No need to hold fs->lock if we are killing it */
+Index: linux-2.6.5-12.1/include/linux/fshooks.h
+===================================================================
+--- linux-2.6.5-12.1.orig/include/linux/fshooks.h 2004-05-10 19:21:56.000000000 +0300
++++ linux-2.6.5-12.1/include/linux/fshooks.h 2004-05-25 17:32:14.048492680 +0300
+@@ -90,12 +90,18 @@
+
+ #define FSHOOK_BEGIN_USER_WALK(type, err, path, flags, nd, field, args...) \
+ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk(path, flags, &nd, &info.field), nd, args)
++#define FSHOOK_BEGIN_USER_WALK_IT(type, err, path, flags, nd, field, args...) \
++ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk_it(path, flags, &nd, &info.field), nd, args)
+
+ #define FSHOOK_BEGIN_USER_PATH_WALK(type, err, path, nd, field, args...) \
+ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk(path, LOOKUP_FOLLOW, &nd, &info.field), nd, args)
++#define FSHOOK_BEGIN_USER_PATH_WALK_IT(type, err, path, nd, field, args...) \
++ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk_it(path, LOOKUP_FOLLOW, &nd, &info.field), nd, args)
+
+ #define FSHOOK_BEGIN_USER_PATH_WALK_LINK(type, err, path, nd, field, args...) \
+ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk(path, 0, &nd, &info.field), nd, args)
++#define FSHOOK_BEGIN_USER_PATH_WALK_LINK_IT(type, err, path, nd, field, args...) \
++ FSHOOK_BEGIN_USER_WALK_COMMON(type, err, __user_walk_it(path, 0, &nd, &info.field), nd, args)
+
+ #define FSHOOK_END_USER_WALK(type, err, field) \
+ (void)(&info != (struct fshook_##type##_info *)-1L); \
+@@ -126,12 +132,18 @@
+
+ #define FSHOOK_BEGIN_USER_WALK(type, err, path, flags, nd, field, args...) \
+ if (!(err = __user_walk(path, flags, &nd, 0))) {
++#define FSHOOK_BEGIN_USER_WALK_IT(type, err, path, flags, nd, field, args...) \
++ if (!(err = __user_walk_it(path, flags, &nd, 0))) {
+
+ #define FSHOOK_BEGIN_USER_PATH_WALK(type, err, path, nd, field, args...) \
+ if (!(err = user_path_walk(path, &nd))) {
++#define FSHOOK_BEGIN_USER_PATH_WALK_IT(type, err, path, nd, field, args...) \
++ if (!(err = user_path_walk_it(path, &nd))) {
+
+ #define FSHOOK_BEGIN_USER_PATH_WALK_LINK(type, err, path, nd, field, args...) \
+ if (!(err = user_path_walk_link(path, &nd))) {
++#define FSHOOK_BEGIN_USER_PATH_WALK_LINK_IT(type, err, path, nd, field, args...) \
++ if (!(err = user_path_walk_link_it(path, &nd))) {
+
+ #define FSHOOK_END_USER_WALK(type, err, field) ((void)0);}
+
+Index: linux-2.6.5-12.1/fs/block_dev.c
+===================================================================
+--- linux-2.6.5-12.1.orig/fs/block_dev.c 2004-05-10 19:21:55.000000000 +0300
++++ linux-2.6.5-12.1/fs/block_dev.c 2004-05-25 17:32:39.517620784 +0300
+@@ -834,6 +834,7 @@
+ if (!path || !*path)
+ return ERR_PTR(-EINVAL);
+
++ intent_init(&nd.intent, IT_LOOKUP);
+ error = path_lookup(path, LOOKUP_FOLLOW, &nd);
+ if (error)
+ return ERR_PTR(error);