From 7d72f7d8ce3c15e25382c6121c374de92fe84775 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 3 Jun 2015 16:44:57 +0200 Subject: keep a read lock while scanning a file or folder --- lib/private/connector/sabre/file.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/private/connector') diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index 5aef30cc577..740660f466b 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -216,15 +216,15 @@ class File extends Node implements IFile { } } - // since we skipped the view we need to scan and emit the hooks ourselves - $partStorage->getScanner()->scanFile($internalPath); - try { $this->fileView->changeLock($this->path, ILockingProvider::LOCK_SHARED); } catch (LockedException $e) { throw new FileLocked($e->getMessage(), $e->getCode(), $e); } + // since we skipped the view we need to scan and emit the hooks ourselves + $partStorage->getScanner()->scanFile($internalPath); + if ($view) { $this->fileView->getUpdater()->propagate($hookPath); if (!$exists) { @@ -249,12 +249,11 @@ class File extends Node implements IFile { } } $this->refreshInfo(); + $this->fileView->unlockFile($this->path, ILockingProvider::LOCK_SHARED); } catch (StorageNotAvailableException $e) { throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage()); } - $this->fileView->unlockFile($this->path, ILockingProvider::LOCK_SHARED); - return '"' . $this->info->getEtag() . '"'; } -- cgit v1.2.3