[PATCH] namei fixes (8/19)
In open_namei() we never use path.mnt or path.dentry after exit: or ok:. Assignment of path.dentry in case of LAST_BIND is dead code and only obfuscates already convoluted function; assignment of path.mnt after __do_follow_link() can be moved down to the place where we set path.dentry. Obviously equivalent transformations, just to clean the air a bit in that region. Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
cd4e91d3bc
commit
d671d5e514
|
@ -1526,14 +1526,11 @@ do_link:
|
||||||
if (error)
|
if (error)
|
||||||
goto exit_dput;
|
goto exit_dput;
|
||||||
error = __do_follow_link(&path, nd);
|
error = __do_follow_link(&path, nd);
|
||||||
path.mnt = nd->mnt;
|
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
nd->flags &= ~LOOKUP_PARENT;
|
nd->flags &= ~LOOKUP_PARENT;
|
||||||
if (nd->last_type == LAST_BIND) {
|
if (nd->last_type == LAST_BIND)
|
||||||
path.dentry = nd->dentry;
|
|
||||||
goto ok;
|
goto ok;
|
||||||
}
|
|
||||||
error = -EISDIR;
|
error = -EISDIR;
|
||||||
if (nd->last_type != LAST_NORM)
|
if (nd->last_type != LAST_NORM)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
@ -1549,6 +1546,7 @@ do_link:
|
||||||
dir = nd->dentry;
|
dir = nd->dentry;
|
||||||
down(&dir->d_inode->i_sem);
|
down(&dir->d_inode->i_sem);
|
||||||
path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
|
path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
|
||||||
|
path.mnt = nd->mnt;
|
||||||
putname(nd->last.name);
|
putname(nd->last.name);
|
||||||
goto do_last;
|
goto do_last;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue