On 2018-03-21 03:46, Nikolay Borisov wrote:
On 20.03.2018 22:06, Goffredo Baroncelli wrote:
On 03/20/2018 07:45 AM, Misono, Tomohiro wrote:
Deletion of subvolume by non-privileged user is completely restricted
by default because we can delete a subvolume even if it is not empty
and may cause data loss. In other words, when user_subvol_rm_allowed
mount option is used, a user can delete a subvolume containing the
directory which cannot be deleted directly by the user.
However, there should be no harm to allow users to delete empty subvolumes
when rmdir(2) would have been allowed if they were normal directories.
This patch allows deletion of empty subvolume by default.
Instead of modifying the ioctl, what about allowing rmdir(2) to work for an
_empty_ subvolume (and all the permission check are satisfied) ?
I'm inclined to agree with Goffredo. user_subvol_rm_allowed flag really
looks like a hack ontop of the ioctl. I'd rather we modify the generic
behavior.
I agree as well, with the addendum that I'd love to see a new ioctl that
does proper permissions checks. While letting rmdir(2) work for an
empty subvolume with the appropriate permissions would be great (it will
let rm -r work correctly), it doesn't address the usefulness of being
able to just `btrfs subvolume delete` and not have to wait for the
command to finish before you can reuse the name.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html