Browse Source
additional debug logging on smb copy/rename failures
Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/7555/head
Robin Appelman
8 years ago
No known key found for this signature in database
GPG Key ID: CBCA68FBAEBF98C9
2 changed files with
5 additions and
0 deletions
-
apps/files_external/lib/Lib/Storage/SMB.php
-
lib/private/Files/Storage/Common.php
|
|
|
@ -52,6 +52,7 @@ use OCP\Files\Notify\IChange; |
|
|
|
use OCP\Files\Notify\IRenameChange; |
|
|
|
use OCP\Files\Storage\INotifyStorage; |
|
|
|
use OCP\Files\StorageNotAvailableException; |
|
|
|
use OCP\Util; |
|
|
|
|
|
|
|
class SMB extends Common implements INotifyStorage { |
|
|
|
/** |
|
|
|
@ -199,6 +200,7 @@ class SMB extends Common implements INotifyStorage { |
|
|
|
$this->remove($target); |
|
|
|
$result = $this->share->rename($absoluteSource, $absoluteTarget); |
|
|
|
} catch (\Exception $e) { |
|
|
|
\OC::$server->getLogger()->logException($e, ['level' => Util::WARN]); |
|
|
|
return false; |
|
|
|
} |
|
|
|
unset($this->statCache[$absoluteSource], $this->statCache[$absoluteTarget]); |
|
|
|
|
|
|
|
@ -229,6 +229,9 @@ abstract class Common implements Storage, ILockingStorage { |
|
|
|
$source = $this->fopen($path1, 'r'); |
|
|
|
$target = $this->fopen($path2, 'w'); |
|
|
|
list(, $result) = \OC_Helper::streamCopy($source, $target); |
|
|
|
if (!$result) { |
|
|
|
\OC::$server->getLogger()->warning("Failed to write data while copying $path1 to $path2"); |
|
|
|
} |
|
|
|
$this->removeCachedFile($path2); |
|
|
|
return $result; |
|
|
|
} |
|
|
|
|