From e286622d0b5dbb7e15a0934c77cbf5f926d9d799 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 18 Mar 2024 16:18:35 +0100 Subject: [PATCH] fix: ensure nested mount points are handled in the correct order Signed-off-by: Robin Appelman --- lib/private/Files/View.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 6eefb093795dd..1d8125febbb1b 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1475,6 +1475,13 @@ public function getDirectoryContent($directory, $mimetype_filter = '', \OCP\File //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();