diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c index b86b96fe1dc3..868d0cb9d473 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -523,9 +523,10 @@ static void path_put_conditional(struct path *path, struct nameidata *nd) | |||
523 | static inline void path_to_nameidata(struct path *path, struct nameidata *nd) | 523 | static inline void path_to_nameidata(struct path *path, struct nameidata *nd) |
524 | { | 524 | { |
525 | dput(nd->path.dentry); | 525 | dput(nd->path.dentry); |
526 | if (nd->path.mnt != path->mnt) | 526 | if (nd->path.mnt != path->mnt) { |
527 | mntput(nd->path.mnt); | 527 | mntput(nd->path.mnt); |
528 | nd->path.mnt = path->mnt; | 528 | nd->path.mnt = path->mnt; |
529 | } | ||
529 | nd->path.dentry = path->dentry; | 530 | nd->path.dentry = path->dentry; |
530 | } | 531 | } |
531 | 532 | ||
@@ -1620,6 +1621,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, | |||
1620 | case LAST_DOTDOT: | 1621 | case LAST_DOTDOT: |
1621 | follow_dotdot(nd); | 1622 | follow_dotdot(nd); |
1622 | dir = nd->path.dentry; | 1623 | dir = nd->path.dentry; |
1624 | case LAST_DOT: | ||
1623 | if (nd->path.mnt->mnt_sb->s_type->fs_flags & FS_REVAL_DOT) { | 1625 | if (nd->path.mnt->mnt_sb->s_type->fs_flags & FS_REVAL_DOT) { |
1624 | if (!dir->d_op->d_revalidate(dir, nd)) { | 1626 | if (!dir->d_op->d_revalidate(dir, nd)) { |
1625 | error = -ESTALE; | 1627 | error = -ESTALE; |
@@ -1627,7 +1629,6 @@ static struct file *do_last(struct nameidata *nd, struct path *path, | |||
1627 | } | 1629 | } |
1628 | } | 1630 | } |
1629 | /* fallthrough */ | 1631 | /* fallthrough */ |
1630 | case LAST_DOT: | ||
1631 | case LAST_ROOT: | 1632 | case LAST_ROOT: |
1632 | if (open_flag & O_CREAT) | 1633 | if (open_flag & O_CREAT) |
1633 | goto exit; | 1634 | goto exit; |