aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/view.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index db904e57cb9..d6cc62dff27 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -49,6 +49,7 @@ use OCP\Files\InvalidCharacterInPathException;
use OCP\Files\InvalidPathException;
use OCP\Files\ReservedWordException;
use OCP\Lock\ILockingProvider;
+use OCP\Lock\LockedException;
/**
* Class to provide access to ownCloud filesystem via a "view", and methods for
@@ -638,7 +639,12 @@ class View {
$internalPath2 = $mount2->getInternalPath($absolutePath2);
$this->lockFile($path1, ILockingProvider::LOCK_EXCLUSIVE);
- $this->lockFile($path2, ILockingProvider::LOCK_EXCLUSIVE);
+ try {
+ $this->lockFile($path2, ILockingProvider::LOCK_EXCLUSIVE);
+ } catch (LockedException $e) {
+ $this->unlockFile($path1, ILockingProvider::LOCK_EXCLUSIVE);
+ throw $e;
+ }
if ($internalPath1 === '' and $mount1 instanceof MoveableMount) {
if ($this->isTargetAllowed($absolutePath2)) {