Fix/57375 zero quota external storage folder delete#59986
Open
huntervcx wants to merge 2 commits intonextcloud:masterfrom
Open
Fix/57375 zero quota external storage folder delete#59986huntervcx wants to merge 2 commits intonextcloud:masterfrom
huntervcx wants to merge 2 commits intonextcloud:masterfrom
Conversation
Author
Behavior Matrix After Full Fix
I'm still not entirely certain whether the behavior for trashbin and versions is fully aligned with the intended design. That said, with this fix, it is now possible to create directories in the user's home even when the quota is set to 0. From Nextcloud’s perspective, this is technically consistent, as empty directories do not consume any storage (0 bytes), and therefore do not violate the quota constraint. |
added 2 commits
April 28, 2026 22:00
Signed-off-by: Arthur Perrot <aperrot@dyb.fr>
Signed-off-by: Arthur Perrot <aperrot@dyb.fr>
8a910a1 to
e4ce8ad
Compare
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.
Summary
Users with quota set to 0 (intentionally, so nothing is stored under their home
files/except structure / external mounts) hit incorrect WebDAV failures:MKCOL / uploads / moves could fail with
507 Insufficient StoragebecauseQuotaPlugintreated directory creation like a fixed byte write (4096) againstfree_space == 0, and the homeQuotawrapper blockedmkdirwhen quota was exhausted.With
files_trashbinenabled, DELETE on items on external storage could return 403 Forbidden (Directory::delete→rmdirfalse) becauseQuota::copyFromStorage/ related write paths did not honorshouldApplyQuota()— writes underfiles_trashbin/were incorrectly subject to the samefree_space == 0gate as real user files underfiles/.This PR aligns quota enforcement with the existing intent of
shouldApplyQuota()(only paths underfiles/count toward user quota):QuotaPlugin: skip pre-quota checks for directory creation (MKCOL); empty dirs do not consume user quota bytes.Quotawrapper: allowmkdirwhen quota is exactly0for empty directories; delegate real file blocking tofopen/file_put_contents/ etc.Quotawrapper: applyshouldApplyQuota()tocopyFromStorage,moveFromStorage,copy,file_put_contents, andtouchso trashbin / versions / metadata paths are not blocked when home quota is0.Unit tests updated in
tests/lib/Files/Storage/Wrapper/QuotaTest.phpandapps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)