diff options
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 3ddfd9046c44..d94ccd6ddafd 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1844,9 +1844,10 @@ static int do_move_mount(struct path *path, char *old_name) | |||
1844 | return err; | 1844 | return err; |
1845 | 1845 | ||
1846 | down_write(&namespace_sem); | 1846 | down_write(&namespace_sem); |
1847 | while (d_mountpoint(path->dentry) && | 1847 | err = follow_down(path, true); |
1848 | follow_down(path)) | 1848 | if (err < 0) |
1849 | ; | 1849 | goto out; |
1850 | |||
1850 | err = -EINVAL; | 1851 | err = -EINVAL; |
1851 | if (!check_mnt(path->mnt) || !check_mnt(old_path.mnt)) | 1852 | if (!check_mnt(path->mnt) || !check_mnt(old_path.mnt)) |
1852 | goto out; | 1853 | goto out; |
@@ -1940,9 +1941,10 @@ int do_add_mount(struct vfsmount *newmnt, struct path *path, | |||
1940 | 1941 | ||
1941 | down_write(&namespace_sem); | 1942 | down_write(&namespace_sem); |
1942 | /* Something was mounted here while we slept */ | 1943 | /* Something was mounted here while we slept */ |
1943 | while (d_mountpoint(path->dentry) && | 1944 | err = follow_down(path, true); |
1944 | follow_down(path)) | 1945 | if (err < 0) |
1945 | ; | 1946 | goto unlock; |
1947 | |||
1946 | err = -EINVAL; | 1948 | err = -EINVAL; |
1947 | if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(path->mnt)) | 1949 | if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(path->mnt)) |
1948 | goto unlock; | 1950 | goto unlock; |