Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-03-24 13:40:14 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-31 00:50:10 +0300
commit7c7e079a3650616e2cd2ac9855b275ddbcf02a67 (patch)
tree94892895636ad631f7a27d05635508400aca49b0 /lib
parented88f7b8b5002f91b0fa6d1970b795d4d47a2222 (diff)
Lock the mountpoint while removing
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/view.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 52be8a7e226..4421a016356 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -269,17 +269,21 @@ class View {
// cut of /user/files to get the relative path to data/user/files
$pathParts = explode('/', $path, 4);
$relPath = '/' . $pathParts[3];
+ $this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true);
\OC_Hook::emit(
Filesystem::CLASSNAME, "umount",
array(Filesystem::signal_param_path => $relPath)
);
+ $this->changeLock($relPath, ILockingProvider::LOCK_EXCLUSIVE, true);
$result = $mount->removeMount();
+ $this->changeLock($relPath, ILockingProvider::LOCK_SHARED, true);
if ($result) {
\OC_Hook::emit(
Filesystem::CLASSNAME, "post_umount",
array(Filesystem::signal_param_path => $relPath)
);
}
+ $this->unlockFile($relPath, ILockingProvider::LOCK_SHARED, true);
return $result;
} else {
// do not allow deleting the storage's root / the mount point