diff options
author | Robin Appelman <robin@icewind.nl> | 2019-01-22 15:32:48 +0100 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-01-22 15:14:34 +0000 |
commit | 9126cdc7a88460c4c8c11c4e6ce29b7a2df932b5 (patch) | |
tree | 8d95a3317e3d6550c0ce4fc3e6e7f082d8298a4d /lib/private | |
parent | e898c52eb0dd52c2db60ba0a78f0434dc4635fee (diff) | |
download | nextcloud-server-9126cdc7a88460c4c8c11c4e6ce29b7a2df932b5.tar.gz nextcloud-server-9126cdc7a88460c4c8c11c4e6ce29b7a2df932b5.zip |
cleanup shared lock if changing to exclusive lock failed
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-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 cd1219fd77e..0acd918f899 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1139,7 +1139,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)) { |