1 Index: linux-2.6.10/fs/namei.c
2 ===================================================================
3 --- linux-2.6.10.orig/fs/namei.c 2005-03-31 17:12:26.403006808 +0800
4 +++ linux-2.6.10/fs/namei.c 2005-03-31 17:20:37.388365688 +0800
8 if (inode->i_op->follow_link) {
9 + int saved_flags = nd->flags;
11 + nd->flags |= LOOKUP_LINK_NOTLAST;
12 err = do_follow_link(next.dentry, nd);
13 + nd->flags = saved_flags;
21 + nd->flags |= LOOKUP_LAST;
22 err = do_lookup(nd, &this, &next, atomic);
23 + nd->flags &= ~LOOKUP_LAST;
26 follow_mount(&next.mnt, &next.dentry);
29 if (nd->dentry && nd->dentry->d_sb &&
30 (nd->dentry->d_sb->s_type->fs_flags & FS_REVAL_DOT)) {
32 + nd->flags |= LOOKUP_LAST;
33 + err = !nd->dentry->d_op->d_revalidate(nd->dentry, nd);
34 + nd->flags &= ~LOOKUP_LAST;
35 /* Note: we do not d_invalidate() */
36 - if (!nd->dentry->d_op->d_revalidate(nd->dentry, nd))
46 nd->flags &= ~LOOKUP_PARENT;
47 down(&dir->d_inode->i_sem);
48 + nd->flags |= LOOKUP_LAST;
49 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
50 + nd->flags &= ~LOOKUP_LAST;
53 error = PTR_ERR(dentry);
57 down(&dir->d_inode->i_sem);
58 + nd->flags |= LOOKUP_LAST;
59 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
60 + nd->flags &= ~LOOKUP_LAST;
61 putname(nd->last.name);
64 Index: linux-2.6.10/include/linux/namei.h
65 ===================================================================
66 --- linux-2.6.10.orig/include/linux/namei.h 2005-03-31 17:10:14.746021712 +0800
67 +++ linux-2.6.10/include/linux/namei.h 2005-03-31 17:21:41.178668088 +0800
69 #define LOOKUP_PARENT 16
70 #define LOOKUP_NOALT 32
71 #define LOOKUP_ATOMIC 64
73 +#define LOOKUP_LAST 128
74 +#define LOOKUP_LINK_NOTLAST 256