Repository navigation
fix(dav): skip quota check when moving file within the same storage - #65484
Open
DarelShroo wants to merge 5 commits into
Open
DarelShroo wants to merge 5 commits into
DarelShroo wants to merge 5 commits into
Conversation
Signed-off-by: Darel Martínez Caballero <darelmartinezcaballero@gmail.com>
DarelShroo
requested review from
icewind1991,
leftybournes,
salmart-dev and
sorbaugh
and removed request for
a team
October 13, 2026 20:09
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Darel Martínez Caballero darelmartinezcaballero@gmail.com
Summary
When moving or renaming files inside the same storage backend (local disk, NFS, or external storage mounts), the net disk space consumed on that storage is zero (an atomic filesystem
rename()/ inode update).Previously,
QuotaPlugin::beforeMove()unconditionally validated whether the destination path had available free space greater than or equal to the entire source file size ($this->checkQuota($quotaPath, $sourceNode->getSize())).On storages with low remaining free space (e.g., 10 GB free on disk) where a user attempts to move or rename a large file (e.g., a 16 GB file) within the same mount or folder structure, Nextcloud aborted the operation throwing a false-positive HTTP 507
InsufficientStorageexception.Solution
In
QuotaPlugin::beforeMove(), we retrieve the storage instances of both the source node and the destination parent path:$sourceStorage = $sourceNode->getFileInfo()?->getStorage();$destStorage = $destInfo?->getStorage();If
$sourceStorage->getId() === $destStorage->getId(), both source and destination resolve to the identical storage backend instance. The net space consumption is zero, so the redundant free-space check is safely bypassed. If the storage cannot be determined or source and destination belong to different storages, it cleanly falls back to the existingcheckQuota()validation.Checklist
3. to review, feature component)stable32)AI (if applicable)
apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php.