aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-03-18 16:18:35 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-03-18 18:01:53 +0000
commit1569469b700eaf4c278a078f63f9965dd16f8ff5 (patch)
tree33a157201e723b58abc6f3606eac879d1b9fb8b2
parent9531b62c9f2e805c79e23d1d727201c5b25c7c4d (diff)
downloadnextcloud-server-1569469b700eaf4c278a078f63f9965dd16f8ff5.tar.gz
nextcloud-server-1569469b700eaf4c278a078f63f9965dd16f8ff5.zip
fix: ensure nested mount points are handled in the correct order
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Files/View.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 43348cf63fd..fb947f606b3 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1475,6 +1475,13 @@ class View {
//add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders
$mounts = Filesystem::getMountManager()->findIn($path);
+
+ // make sure nested mounts are sorted after their parent mounts
+ // otherwise doesn't propagate the etag across storage boundaries correctly
+ usort($mounts, function (IMountPoint $a, IMountPoint $b) {
+ return $a->getMountPoint() <=> $b->getMountPoint();
+ });
+
$dirLength = strlen($path);
foreach ($mounts as $mount) {
$mountPoint = $mount->getMountPoint();