Bug#998840: Strange warning when deleting subvolume as non-root user
----- Forwarded message from Boris Kolpackov <[email protected]> -----
Date: Mon, 8 Nov 2021 16:01:53 +0200
From: Boris Kolpackov <[email protected]>
Subject: Bug#998840: Strange warning when deleting subvolume as non-root user
Package: btrfs-progs
Version: 5.14.1-1
After upgrading from btrfs-progs 5.7-1 with Linux kernel 5.7.6 to btrfs-progs 5.14.1-1 with Linux kernel 5.14.9-2 (from current testing) I see the following strange new warning when deleting the subvolume as non-root user (the filesystem is mounted with user_subvol_rm_allowed):
WARNING: cannot read default subvolume id: Operation not permitted
The subvolume deletion succeeds.
To reproduce, mount a btrfs filesystem with user_subvol_rm_allowed, say, on /mnt and then (assuming non-root user is called nonroot):
# chown nonroot:nonroot /mnt # su - nonroot $ cd /mnt $ btrfs subvol create test Create subvolume './test' $ btrfs subvol delete test WARNING: cannot read default subvolume id: Operation not permitted Delete subvolume (no-commit): '/mnt/test'
Any idea what's going on here and how to get rid of this warning? It adds quite a bit of noise to our logs.
----- End forwarded message -----
Reproduces for me both on 5.14 kernel+progs and 5.15.
Meow!
Signature · 4 lines
⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Vat kind uf sufficiently advanced technology iz dis!? ⢿⡄⠘⠷⠚⠋⠀ -- Genghis Ht'rok'din ⠈⠳⣄⠀⠀⠀⠀
Quoted 29 lines · Adam Borowski
----- Forwarded message from Boris Kolpackov <[email protected]> -----
Date: Mon, 8 Nov 2021 16:01:53 +0200
From: Boris Kolpackov <[email protected]>
Subject: Bug#998840: Strange warning when deleting subvolume as non-root userPackage: btrfs-progs
Version: 5.14.1-1After upgrading from btrfs-progs 5.7-1 with Linux kernel 5.7.6 to btrfs-progs 5.14.1-1 with Linux kernel 5.14.9-2 (from current testing) I see the following strange new warning when deleting the subvolume as non-root user (the filesystem is mounted with
user_subvol_rm_allowed):WARNING: cannot read default subvolume id: Operation not permitted
The subvolume deletion succeeds.
To reproduce, mount a btrfs filesystem with
user_subvol_rm_allowed, say, on /mnt and then (assuming non-root user is called nonroot):# chown nonroot:nonroot /mnt # su - nonroot $ cd /mnt $ btrfs subvol create test Create subvolume './test' $ btrfs subvol delete test WARNING: cannot read default subvolume id: Operation not permitted Delete subvolume (no-commit): '/mnt/test'
Quoted 2 lines
Any idea what's going on here and how to get rid of this warning? It adds quite a bit of noise to our logs.
This error is printed because btrfs-progs checks whether the volume being deleted is the default since this is not allowed. To perform this check we rely on the TREE_SEARCH ioctl which requires the user having CAP_SYS_ADMIN capability.
Quoted 10 lines
----- End forwarded message -----
Reproduces for me both on 5.14 kernel+progs and 5.15.
Meow!