aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index d56a40b5a577..83293be48149 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1935,7 +1935,7 @@ static int prepend_path(const struct path *path, struct path *root,
1935 bool slash = false; 1935 bool slash = false;
1936 int error = 0; 1936 int error = 0;
1937 1937
1938 spin_lock(&vfsmount_lock); 1938 br_read_lock(vfsmount_lock);
1939 while (dentry != root->dentry || vfsmnt != root->mnt) { 1939 while (dentry != root->dentry || vfsmnt != root->mnt) {
1940 struct dentry * parent; 1940 struct dentry * parent;
1941 1941
@@ -1964,7 +1964,7 @@ out:
1964 if (!error && !slash) 1964 if (!error && !slash)
1965 error = prepend(buffer, buflen, "/", 1); 1965 error = prepend(buffer, buflen, "/", 1);
1966 1966
1967 spin_unlock(&vfsmount_lock); 1967 br_read_unlock(vfsmount_lock);
1968 return error; 1968 return error;
1969 1969
1970global_root: 1970global_root:
@@ -2302,11 +2302,12 @@ int path_is_under(struct path *path1, struct path *path2)
2302 struct vfsmount *mnt = path1->mnt; 2302 struct vfsmount *mnt = path1->mnt;
2303 struct dentry *dentry = path1->dentry; 2303 struct dentry *dentry = path1->dentry;
2304 int res; 2304 int res;
2305 spin_lock(&vfsmount_lock); 2305
2306 br_read_lock(vfsmount_lock);
2306 if (mnt != path2->mnt) { 2307 if (mnt != path2->mnt) {
2307 for (;;) { 2308 for (;;) {
2308 if (mnt->mnt_parent == mnt) { 2309 if (mnt->mnt_parent == mnt) {
2309 spin_unlock(&vfsmount_lock); 2310 br_read_unlock(vfsmount_lock);
2310 return 0; 2311 return 0;
2311 } 2312 }
2312 if (mnt->mnt_parent == path2->mnt) 2313 if (mnt->mnt_parent == path2->mnt)
@@ -2316,7 +2317,7 @@ int path_is_under(struct path *path1, struct path *path2)
2316 dentry = mnt->mnt_mountpoint; 2317 dentry = mnt->mnt_mountpoint;
2317 } 2318 }
2318 res = is_subdir(dentry, path2->dentry); 2319 res = is_subdir(dentry, path2->dentry);
2319 spin_unlock(&vfsmount_lock); 2320 br_read_unlock(vfsmount_lock);
2320 return res; 2321 return res;
2321} 2322}
2322EXPORT_SYMBOL(path_is_under); 2323EXPORT_SYMBOL(path_is_under);