Skip to content

Commit

Permalink
fix: ensure nested mount points are handled in the correct order
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Mar 18, 2024
1 parent d69f7e9 commit 2119a18
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,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();
Expand Down

0 comments on commit 2119a18

Please sign in to comment.