diff options
author | Al Viro <viro@www.linux.org.uk> | 2005-06-06 16:36:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-06 17:42:25 -0400 |
commit | d671d5e51400aab03c713a16ce3545aa81ad7b1c (patch) | |
tree | c0ba8f1af3d55320a52024d02be4ab9869a0f6e2 | |
parent | cd4e91d3bca8d5527289f5984cf32e9fe6fb8293 (diff) |
[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>
-rw-r--r-- | fs/namei.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 18ea0606145e..3d08478d3130 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1526,14 +1526,11 @@ do_link: | |||
1526 | if (error) | 1526 | if (error) |
1527 | goto exit_dput; | 1527 | goto exit_dput; |
1528 | error = __do_follow_link(&path, nd); | 1528 | error = __do_follow_link(&path, nd); |
1529 | path.mnt = nd->mnt; | ||
1530 | if (error) | 1529 | if (error) |
1531 | return error; | 1530 | return error; |
1532 | nd->flags &= ~LOOKUP_PARENT; | 1531 | nd->flags &= ~LOOKUP_PARENT; |
1533 | if (nd->last_type == LAST_BIND) { | 1532 | if (nd->last_type == LAST_BIND) |
1534 | path.dentry = nd->dentry; | ||
1535 | goto ok; | 1533 | goto ok; |
1536 | } | ||
1537 | error = -EISDIR; | 1534 | error = -EISDIR; |
1538 | if (nd->last_type != LAST_NORM) | 1535 | if (nd->last_type != LAST_NORM) |
1539 | goto exit; | 1536 | goto exit; |
@@ -1549,6 +1546,7 @@ do_link: | |||
1549 | dir = nd->dentry; | 1546 | dir = nd->dentry; |
1550 | down(&dir->d_inode->i_sem); | 1547 | down(&dir->d_inode->i_sem); |
1551 | path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); | 1548 | path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); |
1549 | path.mnt = nd->mnt; | ||
1552 | putname(nd->last.name); | 1550 | putname(nd->last.name); |
1553 | goto do_last; | 1551 | goto do_last; |
1554 | } | 1552 | } |