diff options
author | Al Viro <viro@www.linux.org.uk> | 2005-06-06 16:36:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-06 17:42:26 -0400 |
commit | a15a3f6fc67d910f43098acec6e19d25a37d7cb9 (patch) | |
tree | f00e6a3f505f2e77568695f6f5e2bd4786fcc8ca /fs/namei.c | |
parent | 2f12dbfbb6286c725c283a169f8f05e89a86848b (diff) |
[PATCH] namei fixes (12/19)
In open_namei() we take mntput(nd->mnt);nd->mnt=path.mnt; out of the if
(__follow_mount(...)), making it conditional on nd->mnt != path.mnt instead.
Then we shift the result downstream.
Equivalent transformations.
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>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 907a3f2b4c9c..37fcf941fa3f 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1506,8 +1506,6 @@ do_last: | |||
1506 | mntput(path.mnt); | 1506 | mntput(path.mnt); |
1507 | goto exit; | 1507 | goto exit; |
1508 | } | 1508 | } |
1509 | mntput(nd->mnt); | ||
1510 | nd->mnt = path.mnt; | ||
1511 | } | 1509 | } |
1512 | error = -ENOENT; | 1510 | error = -ENOENT; |
1513 | if (!path.dentry->d_inode) | 1511 | if (!path.dentry->d_inode) |
@@ -1517,6 +1515,9 @@ do_last: | |||
1517 | 1515 | ||
1518 | dput(nd->dentry); | 1516 | dput(nd->dentry); |
1519 | nd->dentry = path.dentry; | 1517 | nd->dentry = path.dentry; |
1518 | if (nd->mnt != path.mnt) | ||
1519 | mntput(nd->mnt); | ||
1520 | nd->mnt = path.mnt; | ||
1520 | error = -EISDIR; | 1521 | error = -EISDIR; |
1521 | if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode)) | 1522 | if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode)) |
1522 | goto exit; | 1523 | goto exit; |
@@ -1528,6 +1529,9 @@ ok: | |||
1528 | 1529 | ||
1529 | exit_dput: | 1530 | exit_dput: |
1530 | dput(path.dentry); | 1531 | dput(path.dentry); |
1532 | if (nd->mnt != path.mnt) | ||
1533 | mntput(nd->mnt); | ||
1534 | nd->mnt = path.mnt; | ||
1531 | exit: | 1535 | exit: |
1532 | path_release(nd); | 1536 | path_release(nd); |
1533 | return error; | 1537 | return error; |
@@ -1550,6 +1554,9 @@ do_link: | |||
1550 | error = security_inode_follow_link(path.dentry, nd); | 1554 | error = security_inode_follow_link(path.dentry, nd); |
1551 | if (error) | 1555 | if (error) |
1552 | goto exit_dput; | 1556 | goto exit_dput; |
1557 | if (nd->mnt != path.mnt) | ||
1558 | mntput(nd->mnt); | ||
1559 | nd->mnt = path.mnt; | ||
1553 | error = __do_follow_link(&path, nd); | 1560 | error = __do_follow_link(&path, nd); |
1554 | if (error) | 1561 | if (error) |
1555 | return error; | 1562 | return error; |