When reading the size of "files" mountpoints need to be excluded
The versions and trashbin app are now passing "includeMountPoints=false" to "getFileInfo()" to make sure that the calculated total size doesn't include mount points like Shared or external storage. This is because the default call (legacy) used to return the size of mount points as well. Fixes #6731
This commit is contained in:
parent
bd643c47f3
commit
ca57a849ff
|
@ -734,7 +734,7 @@ class Trashbin {
|
||||||
// calculate available space for trash bin
|
// calculate available space for trash bin
|
||||||
// subtract size of files and current trash bin size from quota
|
// subtract size of files and current trash bin size from quota
|
||||||
if ($softQuota) {
|
if ($softQuota) {
|
||||||
$rootInfo = $view->getFileInfo('/files/');
|
$rootInfo = $view->getFileInfo('/files/', false);
|
||||||
$free = $quota - $rootInfo['size']; // remaining free space for user
|
$free = $quota - $rootInfo['size']; // remaining free space for user
|
||||||
if ($free > 0) {
|
if ($free > 0) {
|
||||||
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
|
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
|
||||||
|
|
|
@ -445,7 +445,7 @@ class Storage {
|
||||||
// subtract size of files and current versions size from quota
|
// subtract size of files and current versions size from quota
|
||||||
if ($softQuota) {
|
if ($softQuota) {
|
||||||
$files_view = new \OC\Files\View('/'.$uid.'/files');
|
$files_view = new \OC\Files\View('/'.$uid.'/files');
|
||||||
$rootInfo = $files_view->getFileInfo('/');
|
$rootInfo = $files_view->getFileInfo('/', false);
|
||||||
$free = $quota-$rootInfo['size']; // remaining free space for user
|
$free = $quota-$rootInfo['size']; // remaining free space for user
|
||||||
if ( $free > 0 ) {
|
if ( $free > 0 ) {
|
||||||
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - ($versionsSize + $offset); // how much space can be used for versions
|
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - ($versionsSize + $offset); // how much space can be used for versions
|
||||||
|
|
Loading…
Reference in New Issue