diff options
author | Robin Appelman <robin@icewind.nl> | 2019-01-22 15:32:48 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-01-22 15:32:48 +0100 |
commit | f69c2d1e8443ae23278fdf809b027f9713e3f868 (patch) | |
tree | 361e271348bec6466bf6db31b7a80a817edabb5d /lib | |
parent | b35db6c784d236e1ba0da0dffccef3291df3bb19 (diff) | |
download | nextcloud-server-f69c2d1e8443ae23278fdf809b027f9713e3f868.tar.gz nextcloud-server-f69c2d1e8443ae23278fdf809b027f9713e3f868.zip |
cleanup shared lock if changing to exclusive lock failed
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/View.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 21df67cf557..6066aed411f 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1137,7 +1137,13 @@ class View { list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); if ($run and $storage) { if (in_array('write', $hooks) || in_array('delete', $hooks)) { - $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); + try { + $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); + } catch (LockedException $e) { + // release the shared lock we acquired before quiting + $this->unlockFile($path, ILockingProvider::LOCK_SHARED); + throw $e; + } } try { if (!is_null($extraParam)) { |