Skip to content

Commit

Permalink
Merge pull request #44284 from nextcloud/backport/44279/stable27
Browse files Browse the repository at this point in the history
[stable27] fix: ensure nested mount points are handled in the correct order
  • Loading branch information
susnux authored Mar 19, 2024
2 parents c93a8ed + 1569469 commit d2754fe
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 @@ -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();
Expand Down

0 comments on commit d2754fe

Please sign in to comment.