diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namespace.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 2b12b7a9455d..acc5583764dc 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1669,8 +1669,11 @@ struct vfsmount *collect_mounts(struct path *path) | |||
1669 | { | 1669 | { |
1670 | struct mount *tree; | 1670 | struct mount *tree; |
1671 | namespace_lock(); | 1671 | namespace_lock(); |
1672 | tree = copy_tree(real_mount(path->mnt), path->dentry, | 1672 | if (!check_mnt(real_mount(path->mnt))) |
1673 | CL_COPY_ALL | CL_PRIVATE); | 1673 | tree = ERR_PTR(-EINVAL); |
1674 | else | ||
1675 | tree = copy_tree(real_mount(path->mnt), path->dentry, | ||
1676 | CL_COPY_ALL | CL_PRIVATE); | ||
1674 | namespace_unlock(); | 1677 | namespace_unlock(); |
1675 | if (IS_ERR(tree)) | 1678 | if (IS_ERR(tree)) |
1676 | return ERR_CAST(tree); | 1679 | return ERR_CAST(tree); |