Skip to content

Commit e8687b4

Browse files
icewind1991backportbot[bot]
authored andcommitted
fix: ignore root mount when getting mount for node
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 6ce87f6 commit e8687b4

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

lib/Operation.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,16 @@ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatch
266266
* @param array|ICacheEntry|null $cacheEntry
267267
*/
268268
private function getNode(IStorage $storage, string $path, $cacheEntry = null): ?Node {
269-
/** @var IMountPoint|false $mountPoint */
270-
$mountPoint = current($this->mountManager->findByStorageId($storage->getId()));
269+
$mountPoint = null;
270+
$mounts = $this->mountManager->findByStorageId($storage->getId());
271+
foreach ($mounts as $mount) {
272+
// we don't want to root mount;
273+
if (strlen($mount->getMountPoint()) > 2) {
274+
$mountPoint = $mount;
275+
break;
276+
}
277+
}
278+
271279
if (!$mountPoint) {
272280
return null;
273281
}

0 commit comments

Comments
 (0)