From 842d0e227c601b3fe1c01c4ea613ebf17f2a634a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 2 Feb 2015 17:35:22 +0100 Subject: [PATCH 1/2] Dont update the cache after fopen --- lib/private/files/view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 3bc9fdff1e..120efa0f05 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -811,7 +811,7 @@ class View { if (in_array('delete', $hooks) and $result) { $this->updater->remove($path); } - if (in_array('write', $hooks)) { + if (in_array('write', $hooks) and $operation !== 'fopen') { $this->updater->update($path); } if (in_array('touch', $hooks)) { From adf9a4e4eb4f2eb4b4639d7241fd5a333eed248f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 2 Feb 2015 17:35:40 +0100 Subject: [PATCH 2/2] Dont bother updating the cache when working with part files --- lib/private/files/cache/updater.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index 31a4a7c21e..9f4cbfeff8 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -31,6 +31,9 @@ class Updater { } public function propagate($path, $time = null) { + if (Scanner::isPartialFile($path)) { + return; + } $this->propagator->addChange($path); $this->propagator->propagateChanges($time); } @@ -42,6 +45,9 @@ class Updater { * @param int $time */ public function update($path, $time = null) { + if(Scanner::isPartialFile($path)) { + return; + } /** * @var \OC\Files\Storage\Storage $storage * @var string $internalPath @@ -64,6 +70,9 @@ class Updater { * @param string $path */ public function remove($path) { + if (Scanner::isPartialFile($path)) { + return; + } /** * @var \OC\Files\Storage\Storage $storage * @var string $internalPath @@ -88,6 +97,9 @@ class Updater { * @param string $target */ public function rename($source, $target) { + if (Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) { + return; + } /** * @var \OC\Files\Storage\Storage $sourceStorage * @var \OC\Files\Storage\Storage $targetStorage