mirror of
https://github.com/nextcloud/server.git
synced 2026-02-23 09:53:17 -05:00
Merge pull request #23995 from nextcloud/backport/23741/stable20
[stable20] Unlock when promoting to exclusive lock fails
This commit is contained in:
commit
bf6aa03eb3
1 changed files with 7 additions and 1 deletions
|
|
@ -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 */
|
||||
[$storage, $internalPath] = $this->resolvePath($path);
|
||||
|
|
|
|||
Loading…
Reference in a new issue