summaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 99db05f65c2..f410fdc8c00 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -771,9 +771,12 @@ class View {
} else {
$result = $storage2->copyFromStorage($storage1, $internalPath1, $internalPath2);
}
+
+ $this->changeLock($path2, ILockingProvider::LOCK_SHARED);
+
$this->updater->update($path2);
- $this->unlockFile($path2, ILockingProvider::LOCK_EXCLUSIVE);
+ $this->unlockFile($path2, ILockingProvider::LOCK_SHARED);
$this->unlockFile($path1, ILockingProvider::LOCK_SHARED);
if ($this->shouldEmitHooks() && $result !== false) {
@@ -996,6 +999,10 @@ class View {
throw $e;
}
+ if ((in_array('write', $hooks) || in_array('delete', $hooks)) && $operation !== 'fopen') {
+ $this->changeLock($path, ILockingProvider::LOCK_SHARED);
+ }
+
if (in_array('delete', $hooks) and $result) {
$this->updater->remove($path);
}
@@ -1014,12 +1021,8 @@ class View {
$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
}
});
- } else {
- if (in_array('write', $hooks) || in_array('delete', $hooks)) {
- $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
- } else if (in_array('read', $hooks)) {
- $this->unlockFile($path, ILockingProvider::LOCK_SHARED);
- }
+ } else if (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks)) {
+ $this->unlockFile($path, ILockingProvider::LOCK_SHARED);
}