On 05/07/2023 21:53, Qu Wenruo wrote: > [...] > Personally speaking, I would go one of the following solution: > > - Keep the sysfs, but adds a refcount to the sysfs related structures > If we still go register the sysfs interface, then we have to keep a > refcount, or any of the same fsid got unmounted, we would remove the > whole sysfs entry. > > - Skip the sysfs entry completely for any fs with the new compat_ro flag > This would your idea (III), but the sysfs interface itself is not that > critical (we add and remove entries from time to time), so I believe > it's feasible to hide the sysfs for certain features. > Hi Qu, thanks for you prompt response. I've been trying to mess with btrfs sysfs to allow two same fsid co-existing, without success. For each corner case I handle, two more show-up heh Seems quite tricky and error-prone to have this "special-casing" of sysfs just to accommodate this feature. Are you strongly against keeping the previous idea, of a spoofed/virtual fsid, but applied to the compat_ro single_dev idea? This way, all of this sysfs situation (and other potentially hidden corner cases) would be avoided. That's like my suggestion (I). David / Anand, any thoughts/ideas? Thanks in advance! >> [...] >> Also, one last question/confirmation: you mentioned that "The better >> method to enable/disable a feature should be mkfs" - you mean the same >> way mkfs could be used to set features like "raid56" or "no-holes"? > > Yes. > >> [...] > I'm not familiar with metadata_uuid, but there are similar features like > seeding, which is only available in btrfstune, but not in mkfs. > > It's not that uncommon, but yeah, you have found something we should > improve on. > Thanks for confirming, I could implement it in both mkfs and btrfstune - seems the more consistent path. Cheers, Guilherme