On 22/01/2021 22:42, Zygo Blaxell wrote: ... >> So the point is: what happens if the root subvolume is not mounted ? > > It's not an onerous requirement to mount the root subvol. You can do (*) > > tmp="$(mktemp -d)" > mount -osubvolid=5 /dev/btrfs "$tmp" > setfattr -n 'btrfs...' -v... "$tmp" > umount "$tmp" > rmdir "$tmp"
No! I may have other data on that disk which I do NOT want to become accessible to users on this system (even for a short time). As a simple example, imagine, a disk I carry around to take emergency backups of other systems, but I need to change this attribute to make the emergency backup of this system run as quickly as possible before the system dies. Or a disk used for audit trails, where users should not be able to modify their earlier data. Or where I suspect a security breach has occurred. I need to be able to be confident that the only data accessible on this system is data in the specific subvolume I have mounted. Also, the backup problem is a very real problem - abusing xattrs for filesystem controls really screws up writing backup procedures to correctly backup xattrs used to describe or manage data (or for any other purpose). I suppose btrfs can internally store it in an xattr if it wants, as long as any values set are just ignored and changes happen through some other operation (e.g. sysfs). It still might confuse programs like rsync which would try to reset the values each time a sync is done.