Merge pull request #23741 from Ashod/lock-leak
Unlock when promoting to exclusive lock fails
This commit is contained in:
commit
005a132938
|
@ -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 New Issue