also compare storage ids when checking for changed mounts

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-12-13 12:10:44 +01:00
parent 0c6c85bafb
commit 6f46a8bd5b
No known key found for this signature in database
GPG key ID: 425003AC385454C5

View file

@ -141,7 +141,11 @@ class UserMountCache implements IUserMountCache {
foreach ($cachedMounts as $cachedMount) {
if (
$newMount->getRootId() === $cachedMount->getRootId() &&
($newMount->getMountPoint() !== $cachedMount->getMountPoint() || $newMount->getMountId() !== $cachedMount->getMountId())
(
$newMount->getMountPoint() !== $cachedMount->getMountPoint() ||
$newMount->getStorageId() !== $cachedMount->getStorageId() ||
$newMount->getMountId() !== $cachedMount->getMountId()
)
) {
$changed[] = $newMount;
}
@ -169,6 +173,7 @@ class UserMountCache implements IUserMountCache {
$builder = $this->connection->getQueryBuilder();
$query = $builder->update('mounts')
->set('storage_id', $builder->createNamedParameter($mount->getStorageId()))
->set('mount_point', $builder->createNamedParameter($mount->getMountPoint()))
->set('mount_id', $builder->createNamedParameter($mount->getMountId(), IQueryBuilder::PARAM_INT))
->where($builder->expr()->eq('user_id', $builder->createNamedParameter($mount->getUser()->getUID())))