Skip to content

Commit

Permalink
Merge pull request #44279 from nextcloud/sort-submount-view
Browse files Browse the repository at this point in the history
fix: ensure nested mount points are handled in the correct order
  • Loading branch information
icewind1991 authored Mar 18, 2024
2 parents 116b176 + afb589a commit 79e9cdc
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 @@ -1481,6 +1481,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 79e9cdc

Please sign in to comment.