Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block creation of system reserved Share names #2881

Closed
phillxnet opened this issue Jul 26, 2024 · 5 comments
Closed

Block creation of system reserved Share names #2881

phillxnet opened this issue Jul 26, 2024 · 5 comments
Assignees

Comments

@phillxnet
Copy link
Member

Thanks to forum member andyz for highlighting this issue. We have a hard limitation regarding unique btrfs vol (Pool) and btrfs subvol (Share) naming. But prior to (current testing phase):

Un special-case system drive btrfs-in-partition treatment #2824 #2835

we always auto imported the ROOT system Pool (btrfs vol), with it's 'special' home Share (btrfs subvol). And similarly identified this home Share by name as 'special': limiting the available functions as a result. But we are now missing a block against folks creating a home Share which would prior to the referenced changes always already exist. So our existing no-duplicate Share/Pool names block avoided the duplication.

Ergo we now need to guard against folks creating a home Share via the Web-UI as this would then cause a potential clash if, at a later date, folks wanted to import the system Pool. It would also introduce a source of confusion re two subvols named the same - which we normally avoid via our existing hard limitation.


Forum thread reference: https://forum.rockstor.com/t/newly-created-test-share-named-home-cannot-be-resized-nor-deleted/9620

@phillxnet phillxnet added this to the 5.1.X-X Stable release milestone Jul 26, 2024
@phillxnet
Copy link
Member Author

N.B. similarly we should block all default subvol names found on our upstream OS ROOT pool. As we filtered most out from the Web-UI and surfaced only home by way of continuity form our prior OS base of CentOS which has a very different arrangment btrfs wise. But we aimed to make user transition as smooth as possible: hence this gradual transition to proper system/data separation re no default system pool import etc.

@Hooverdan96
Copy link
Member

Do you think that will end up being a static filter, or is there a way to suss out the existing ones and add to a filter set? Not sure that these things change all that much in upstream, so a dynamic way might be overkill?

@phillxnet
Copy link
Member Author

@Hooverdan96 Not sure really. There is also a complexity wrinkle re subvolumes as we default to boot to snapshot. I remember it being quite tricky to assess root subolumes in a boot to snapshot arrangement (our default) and we account for non boot-to-snapshot also. So I think, at this stage in testing, I was going to opt for the default filesystem arrangement as per openSUSE which I think is not likely to change that much. We can enhance some later: and we currently have a static filter for removing them form the Web-UI so I was hoping we can use the same to also block their creation also.

@phillxnet
Copy link
Member Author

phillxnet commented Jul 26, 2024

Having a quick look now - given we need to get Stable out as soon as possible.

This is our existing excludes for subvols not to display/concern ourselves with:

ROOT_SUBVOL_EXCLUDE = [
"root",
"@",
"@/root",
"tmp",
"@/tmp",
"var",
"@/var",
"boot/grub2/i386-pc",
"@/boot/grub2/i386-pc",
"boot/grub2/x86_64-efi",
"@/boot/grub2/x86_64-efi",
"boot/grub2/arm64-efi",
"@/boot/grub2/arm64-efi",
"srv",
"@/srv",
"usr/local",
"@/usr/local",
"opt",
"@/opt",
"root/var/lib/machines",
"@/.snapshots",
".snapshots",
]
# Note in the above we have a non symmetrical exclusions entry of '@/.snapshots
# this is to help distinguish our .snapshots from snapper's rollback subvol.
# System-wide subvolume exclude list.
SUBVOL_EXCLUDE = [".beeshome", "@/.beeshome"]

I'm thinking, at least initially, that we exclude the creation of all SUBVOL_EXCLUDE (which should be Web-UI excludes) and have an additional list containing 'home', so we still show home on ROOT pool import but have it blocked via it's own blacklist.

That static list has thus-far served us for the entire life-cycle of Leap 15.0 (from beta). So it should serve us OK for the remainder of Leap at least: fingers crossed.

@phillxnet phillxnet self-assigned this Jul 26, 2024
@phillxnet phillxnet changed the title Block creation of `home' Share Block creation of system reserved Share names Jul 26, 2024
phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Jul 26, 2024
Use/extend existing knowledge of system associated
subvolumes to avoid breaking (optional) ROOT pool
import, and non-optional system unique share names.

Includes:
- Addition of CREATE_SUBVOL_EXCLUDE list.
- Block creation of all currently EXCLUDED subvol names,
previously used only to avoid Web-UI surfacing.
- Incidental string.format to fstrings in share.py.
- Additional unit test to exercise added Share creation
filter.
phillxnet added a commit that referenced this issue Aug 12, 2024
…-reserved-Share-names

Block creation of system reserved Share names #2881
@phillxnet
Copy link
Member Author

Closing as:
Fixed by #2882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants