diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index f0adedaa8f813..c545ca3842059 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -102,7 +102,7 @@ public function registerMounts(IUser $user, array $mounts, array $mountProviderC if (is_array($mountProviderClasses)) { $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ( $mountProviderClasses - ) { + ): bool { return in_array($mountInfo->getMountProvider(), $mountProviderClasses); }); } @@ -139,7 +139,7 @@ public function registerMounts(IUser $user, array $mounts, array $mountProviderC $this->removeFromCache($mount); foreach ($mountsForUsers as $index => $mountForUser) { /** @var ICachedMountInfo $mountForUser */ - if ($mount->getRootId() == $mountForUser->getRootId() && $mount->getMountPoint() == $mountForUser->getMountPoint()) { + if ($mount->getRootId() === $mountForUser->getRootId() && $mount->getMountPoint() === $mountForUser->getMountPoint()) { unset($mountsForUsers[$index]); break; } diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index adb3928b28ab4..53fca2176bad1 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -75,9 +75,13 @@ public function __construct($params) { if (isset($params['objectPrefix'])) { $this->objectPrefix = $params['objectPrefix']; } - //initialize cache with root directory in cache - if (!$this->is_dir('/')) { - $this->mkdir('/'); + + // home storage is setup in the SetupManager + if (!$this instanceof HomeObjectStoreStorage) { + //initialize cache with root directory in cache + if (!$this->is_dir('/')) { + $this->mkdir('/'); + } } $this->logger = \OC::$server->getLogger(); diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index 2be119af5afb5..8dcc9d83d4369 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -239,8 +239,10 @@ private function oneTimeUserSetup(IUser $user) { $this->mountManager->addMount($homeMount); if ($homeMount->getStorageRootId() === -1) { - $homeMount->getStorage()->mkdir(''); - $homeMount->getStorage()->getScanner()->scan(''); + $homeStorage = $homeMount->getStorage(); + $homeStorage->mkdir(''); + $homeStorage->mkdir('files'); + $homeStorage->getScanner()->scan(''); } $provider = $homeMount->getMountProvider();