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
parent
commit
4f0d03e172
No known key found for this signature in database GPG Key ID: CBCA68FBAEBF98C9
  1. 2
      apps/files_external/lib/Lib/Storage/SMB.php
  2. 3
      lib/private/Files/Storage/Common.php

2
apps/files_external/lib/Lib/Storage/SMB.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]);

3
lib/private/Files/Storage/Common.php

@ -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;
}

Loading…
Cancel
Save