fix: guard raid setup and fix file share over-removal - #2182
Open
mrv777 wants to merge 2 commits into
Open
Conversation
- raid: throw in setup() if an array already exists, so the dev/testing setup route can't repartition and destroy a live pool. - files: only remove shares for the deleted path or its children, not siblings. deleting /External/Drive/Foo was also removing the share for /External/Drive/Foobar.
delete() used the raw path for the /External share check, so a trailing slash (e.g. /External/Drive/Folder/) skipped child shares. normalize up front like list() does.
mrv777
marked this pull request as ready for review
June 30, 2026 17:28
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.
Two small safety fixes from going over the storage code, both independent.
raid setup guard
setup()partitions the devices and creates a fresh pool. ThesetuptRPC route is still live (marked dev/testing) and doesn't check for an existing array, so calling it with the current devices would wipe the live pool. Added a check to throw if an array already exists. Safe on fresh devices (getStatus returns exists: false with no pool) and on the onboarding setup path which runs before any pool exists.file share over-removal
When deleting a path under /External we remove its shares with
startsWith, which also matched siblings. Deleting /External/Drive/Foo would remove the share for /External/Drive/Foobar too. Now matches the exact path or a real child (path + '/').Typecheck passes.