Skip to content

Commit 225badb

Browse files
icewind1991backportbot[bot]
authored andcommitted
fix: fix updating cached mounts with multiple entries for root id
Signed-off-by: Robin Appelman <[email protected]>
1 parent 3ed578f commit 225badb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/private/Files/Config/UserMountCache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ private function addToCache(ICachedMountInfo $mount) {
194194

195195
private function updateCachedMount(ICachedMountInfo $mount) {
196196
$builder = $this->connection->getQueryBuilder();
197+
$hash = hash('xxh128', $mount->getMountPoint());
197198

198199
$query = $builder->update('mounts')
199200
->set('storage_id', $builder->createNamedParameter($mount->getStorageId()))
200-
->set('mount_point', $builder->createNamedParameter($mount->getMountPoint()))
201-
->set('mount_point_hash', $builder->createNamedParameter(hash('xxh128', $mount->getMountPoint())))
202201
->set('mount_id', $builder->createNamedParameter($mount->getMountId(), IQueryBuilder::PARAM_INT))
203202
->set('mount_provider_class', $builder->createNamedParameter($mount->getMountProvider()))
204203
->where($builder->expr()->eq('user_id', $builder->createNamedParameter($mount->getUser()->getUID())))
205-
->andWhere($builder->expr()->eq('root_id', $builder->createNamedParameter($mount->getRootId(), IQueryBuilder::PARAM_INT)));
204+
->andWhere($builder->expr()->eq('root_id', $builder->createNamedParameter($mount->getRootId(), IQueryBuilder::PARAM_INT)))
205+
->andWhere($builder->expr()->eq('mount_point_hash', $builder->createNamedParameter($hash)));
206206

207207
$query->executeStatement();
208208
}

0 commit comments

Comments
 (0)