Merge pull request #24076 from nextcloud/backport/23741/stable19
[stable19] Unlock when promoting to exclusive lock fails
This commit is contained in:
commit
8de8bd2326
|
@ -665,7 +665,13 @@ class View {
|
||||||
return false;
|
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 */
|
/** @var \OC\Files\Storage\Storage $storage */
|
||||||
list($storage, $internalPath) = $this->resolvePath($path);
|
list($storage, $internalPath) = $this->resolvePath($path);
|
||||||
|
|
Loading…
Reference in New Issue