Merge pull request #7555 from nextcloud/smb-copy-rename-log
additional debug logging on smb copy/rename failures
This commit is contained in:
commit
bdf4111013
2 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue