diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-01-22 16:11:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 16:11:46 +0100 |
commit | 90e985fe4f3df5174611490923b91457f6afc342 (patch) | |
tree | 115d66f4c114f21e93fdabe361bb42d08cd1cf2c /lib | |
parent | 0d33302350faba0eb7cf543d8eef225c7e77fddd (diff) | |
parent | f69c2d1e8443ae23278fdf809b027f9713e3f868 (diff) | |
download | nextcloud-server-90e985fe4f3df5174611490923b91457f6afc342.tar.gz nextcloud-server-90e985fe4f3df5174611490923b91457f6afc342.zip |
Merge pull request #13739 from nextcloud/cache-cleanup-change
cleanup shared lock if changing to exclusive lock failed
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)) { |