From 5b231e76c0bdcdae07accd49e0e421c99ada366f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 4 Mar 2026 18:43:55 +0100 Subject: [PATCH] fix: fix updating cached mounts with multiple entries for root id Signed-off-by: Robin Appelman --- lib/private/Files/Config/UserMountCache.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 7079c8a2957..374a80e3203 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -192,15 +192,15 @@ class UserMountCache implements IUserMountCache { private function updateCachedMount(ICachedMountInfo $mount) { $builder = $this->connection->getQueryBuilder(); + $hash = hash('xxh128', $mount->getMountPoint()); $query = $builder->update('mounts') ->set('storage_id', $builder->createNamedParameter($mount->getStorageId())) - ->set('mount_point', $builder->createNamedParameter($mount->getMountPoint())) - ->set('mount_point_hash', $builder->createNamedParameter(hash('xxh128', $mount->getMountPoint()))) ->set('mount_id', $builder->createNamedParameter($mount->getMountId(), IQueryBuilder::PARAM_INT)) ->set('mount_provider_class', $builder->createNamedParameter($mount->getMountProvider())) ->where($builder->expr()->eq('user_id', $builder->createNamedParameter($mount->getUser()->getUID()))) - ->andWhere($builder->expr()->eq('root_id', $builder->createNamedParameter($mount->getRootId(), IQueryBuilder::PARAM_INT))); + ->andWhere($builder->expr()->eq('root_id', $builder->createNamedParameter($mount->getRootId(), IQueryBuilder::PARAM_INT))) + ->andWhere($builder->expr()->eq('mount_point_hash', $builder->createNamedParameter($hash))); $query->executeStatement(); }