diff options
author | Robin Appelman <robin@icewind.nl> | 2022-04-28 16:39:01 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-09-13 15:04:25 +0300 |
commit | 2332aa8fb7c3c69abb52a42140ea4fb9aaafc645 (patch) | |
tree | 56ccb6234e89b698d7ef096e6c7c5ee5ec749206 | |
parent | d0279cc03b4efc0721a282f4a0fe2d9479bb89d2 (diff) |
fix user folder initfile-cache-gc-no-full-setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 4 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 10 | ||||
-rw-r--r-- | lib/private/Files/SetupManager.php | 6 |
3 files changed, 13 insertions, 7 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 572b924b6d3..c7fe82257e6 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -91,7 +91,7 @@ class UserMountCache implements IUserMountCache { $cachedMounts = $this->getMountsForUser($user); if (is_array($mountProviderClasses)) { - $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts) { + $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts): bool { // for existing mounts that didn't have a mount provider set // we still want the ones that map to new mounts if ($mountInfo->getMountProvider() === '' && isset($newMounts[$mountInfo->getRootId()])) { @@ -134,7 +134,7 @@ class UserMountCache implements IUserMountCache { $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 898f64d97c2..d656fbecbda 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -75,9 +75,13 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { 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 4bfbb553600..b3c78e44187 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -254,8 +254,10 @@ class SetupManager { $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(); |