Skip to content

RFE, Remove warning when deleting subvolume as a regular user with user_subvol_rm_allowed #975

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

Open
cvlc12 opened this issue Apr 5, 2025 · 4 comments

Comments

@cvlc12
Copy link

cvlc12 commented Apr 5, 2025

Hi,

When deleting a subvol as a regular user with user_subvol_rm_allowed (See #252), a confusing WARNING is printed, even though the subvolume is properly deleted.

$ btrfs subvolume create bob
$ btrfs subvolume delete bob
WARNING: cannot read default subvolume id: Operation not permitted
Delete subvolume 332 (no-commit): '/home/user/Projets/Sandbox/bob'

Is is really necessary to print this warning ?

Have a good day

@kdave
Copy link
Owner

kdave commented Apr 6, 2025

The default subvolume cannot be deleted and both userspace and kernel do the check. It's there to distinguish the "what you want to delete is possible but forbidden because it's default subvolume" and "you cannot delete the subvolume due to permissions". Even with user_subvol_rm_allowed you may not be able to delete the subvolume and it's not outright clear why. So if the warning explains that, I think it could stay. What do you think about that?

@adam900710
Copy link
Collaborator

I think we should improve the message, so that if the deletion is an unprivileged one, we should not output that error message, or improve it to something like "unable to determine the default subvolume, skipping".

As if later it turns out to be the default one, kernel will reject it anyway.

@cvlc12
Copy link
Author

cvlc12 commented Apr 7, 2025

The default subvolume cannot be deleted and both userspace and kernel do the check. It's there to distinguish the "what you want to delete is possible but forbidden because it's default subvolume" and "you cannot delete the subvolume due to permissions". Even with user_subvol_rm_allowed you may not be able to delete the subvolume and it's not outright clear why. So if the warning explains that, I think it could stay. What do you think about that?

Hmm, I'm confused, I'm not trying to delete the default subvolume at all.

Just create a random subvolume as a regular user, then try to delete it. With user_subvol_rm_allowed set, the subvolume is properly deleted, but a confusing warning is printed.

@cvlc12
Copy link
Author

cvlc12 commented Apr 7, 2025

As a side note, shouldn't $ btrfs subvolume list /home/user work as a normal user? At least with user_subvol_rm_allowed set?

Does it make sense that a user can delete subvolumes, but not list them?

$ btrfs subvolume list /home/user
ERROR: can't perform the search: Operation not permitted

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

No branches or pull requests

3 participants