diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index 167f19b5e51a..e42f7c35545a 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1442,6 +1442,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) | |||
1442 | nd->flags &= ~LOOKUP_PARENT; | 1442 | nd->flags &= ~LOOKUP_PARENT; |
1443 | down(&dir->d_inode->i_sem); | 1443 | down(&dir->d_inode->i_sem); |
1444 | path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); | 1444 | path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); |
1445 | path.mnt = nd->mnt; | ||
1445 | 1446 | ||
1446 | do_last: | 1447 | do_last: |
1447 | error = PTR_ERR(path.dentry); | 1448 | error = PTR_ERR(path.dentry); |
@@ -1479,7 +1480,8 @@ do_last: | |||
1479 | error = -ELOOP; | 1480 | error = -ELOOP; |
1480 | if (flag & O_NOFOLLOW) | 1481 | if (flag & O_NOFOLLOW) |
1481 | goto exit_dput; | 1482 | goto exit_dput; |
1482 | while (__follow_down(&nd->mnt,&path.dentry) && d_mountpoint(path.dentry)); | 1483 | while (__follow_down(&path.mnt,&path.dentry) && d_mountpoint(path.dentry)); |
1484 | nd->mnt = path.mnt; | ||
1483 | } | 1485 | } |
1484 | error = -ENOENT; | 1486 | error = -ENOENT; |
1485 | if (!path.dentry->d_inode) | 1487 | if (!path.dentry->d_inode) |
@@ -1524,6 +1526,7 @@ do_link: | |||
1524 | goto exit_dput; | 1526 | goto exit_dput; |
1525 | error = __do_follow_link(path.dentry, nd); | 1527 | error = __do_follow_link(path.dentry, nd); |
1526 | dput(path.dentry); | 1528 | dput(path.dentry); |
1529 | path.mnt = nd->mnt; | ||
1527 | if (error) | 1530 | if (error) |
1528 | return error; | 1531 | return error; |
1529 | nd->flags &= ~LOOKUP_PARENT; | 1532 | nd->flags &= ~LOOKUP_PARENT; |