diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-11-16 17:07:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 17:07:05 +0100 |
commit | 8de8bd2326db850743c808172cc53b07d242ede7 (patch) | |
tree | c02d4b265bac9331bc7d5a8a14954641c73b411b /lib | |
parent | fd3db61cff732ba96bc6cce208b90d79e5373cc0 (diff) | |
parent | da7f445179ba682cea57be621caf0da3b7d637bc (diff) | |
download | nextcloud-server-8de8bd2326db850743c808172cc53b07d242ede7.tar.gz nextcloud-server-8de8bd2326db850743c808172cc53b07d242ede7.zip |
Merge pull request #24076 from nextcloud/backport/23741/stable19
[stable19] Unlock when promoting to exclusive lock fails
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 ef8656258d1..0c0bef6600a 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -665,7 +665,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); |