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:
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 9aaa37feee9..6ce13d9ca51 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -663,7 +663,13 @@ class View {
return false;
}
- $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE);
+ try {
+ $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE);
+ } catch (\Exception $e) {
+ // Release the shared lock before throwing.
+ $this->unlockFile($path, ILockingProvider::LOCK_SHARED);
+ throw $e;
+ }
/** @var \OC\Files\Storage\Storage $storage */
list($storage, $internalPath) = $this->resolvePath($path);