diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-04-29 04:14:24 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-04-29 04:14:24 -0700 |
| commit | 85d217f40107c3cfe9b7d316022beaf667dc8ef8 (patch) | |
| tree | df5bfb7aeda106457ceeda0e2bd586242f2d61d7 /include/linux/fs_struct.h | |
| parent | 7ca320475b62b1fbd94f772d9d6243b293b29f95 (diff) | |
[PATCH] Re: 2.5.11 breakage
OK, here comes. Patch below is an attempt to do the fastwalk
stuff in right way and so far it seems to be working.
- dentry leak is plugged
- locked/unlocked state of nameidata doesn't depend on history - it
depends only on point in code.
- LOOKUP_LOCKED is gone.
- following mounts and .. doesn't drop dcache_lock
- light-weight permission check distinguishes between "don't know" and
"permission denied", so we don't call full-blown permission() unless
we have to.
- code that changes root/pwd holds dcache_lock _and_ write lock on
current->fs->lock. I.e. if we hold dcache_lock we can safely
access our ->fs->{root,pwd}{,mnt}
- __d_lookup() does not increment refcount; callers do dget_locked()
if they need it (behaviour of d_lookup() didn't change, obviously).
- link_path_walk() logics had been (somewhat) cleaned up.
Diffstat (limited to 'include/linux/fs_struct.h')
| -rw-r--r-- | include/linux/fs_struct.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 1082b5b16694..9ca04a715fe3 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h @@ -35,10 +35,12 @@ static inline void set_fs_root(struct fs_struct *fs, struct dentry *old_root; struct vfsmount *old_rootmnt; write_lock(&fs->lock); + spin_lock(&dcache_lock); old_root = fs->root; old_rootmnt = fs->rootmnt; fs->rootmnt = mntget(mnt); fs->root = dget(dentry); + spin_unlock(&dcache_lock); write_unlock(&fs->lock); if (old_root) { dput(old_root); @@ -58,10 +60,12 @@ static inline void set_fs_pwd(struct fs_struct *fs, struct dentry *old_pwd; struct vfsmount *old_pwdmnt; write_lock(&fs->lock); + spin_lock(&dcache_lock); old_pwd = fs->pwd; old_pwdmnt = fs->pwdmnt; fs->pwdmnt = mntget(mnt); fs->pwd = dget(dentry); + spin_unlock(&dcache_lock); write_unlock(&fs->lock); if (old_pwd) { dput(old_pwd); |
