Skip to content
Snippets Groups Projects
Commit 3d9863fe authored by Joas Schilling's avatar Joas Schilling
Browse files

Lock the mountpoint while removing

parent a355e3ab
No related branches found
No related tags found
No related merge requests found
...@@ -269,17 +269,21 @@ class View { ...@@ -269,17 +269,21 @@ class View {
// cut of /user/files to get the relative path to data/user/files // cut of /user/files to get the relative path to data/user/files
$pathParts = explode('/', $path, 4); $pathParts = explode('/', $path, 4);
$relPath = '/' . $pathParts[3]; $relPath = '/' . $pathParts[3];
$this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true);
\OC_Hook::emit( \OC_Hook::emit(
Filesystem::CLASSNAME, "umount", Filesystem::CLASSNAME, "umount",
array(Filesystem::signal_param_path => $relPath) array(Filesystem::signal_param_path => $relPath)
); );
$this->changeLock($relPath, ILockingProvider::LOCK_EXCLUSIVE, true);
$result = $mount->removeMount(); $result = $mount->removeMount();
$this->changeLock($relPath, ILockingProvider::LOCK_SHARED, true);
if ($result) { if ($result) {
\OC_Hook::emit( \OC_Hook::emit(
Filesystem::CLASSNAME, "post_umount", Filesystem::CLASSNAME, "post_umount",
array(Filesystem::signal_param_path => $relPath) array(Filesystem::signal_param_path => $relPath)
); );
} }
$this->unlockFile($relPath, ILockingProvider::LOCK_SHARED, true);
return $result; return $result;
} else { } else {
// do not allow deleting the storage's root / the mount point // do not allow deleting the storage's root / the mount point
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment