I agree btrfstune should have ability to read the parameter. But none of the btrsftune parameter [1] which it sets, aren't readable using btrfstune. So can we first design how are going to do it for rest of the parameters in btrfstune then later this patch can just fix for seed.

[1]
usage: btrfstune [options] device
-S value positive value will enable seeding, zero to disable, negative is not allowed
        -r              enable extended inode refs
        -x              enable skinny metadata extent refs
        -n              enable no-holes feature (more efficient sparse file 
representation)
-f force to do dangerous operation, make sure that you are aware of the dangers
        -u              change fsid, use a random one
        -U UUID         change fsid to UUID


One suggestion
   btrfstune read -<S|r|x|n|u> <dev>




On 01/04/2019 06:26 PM, David Disseldorp wrote:
On Fri, 4 Jan 2019 09:05:00 +0200, Nikolay Borisov wrote:

btrfs inspect-internal dump-super already supports showing seeding, why
do we need btrfstune support for that as well?

Ah, I wasn't aware of that. IMO the logical place to look is next to
where the user enables seeding (btrfstune -S1).

Also the way you've
phrased is a bit misleading, since checking the superflag doesn't mean
seeding for a particular _device_ is enabled but that the filesystem
itself is set as seeding.

Not quite sure I follow. For a multi-dev FS (one seeding), I see:

rapido1:/# btrfstune -s /dev/zram0
Seeding flag is currently unset
rapido1:/# btrfstune -S 1 /dev/zram0
rapido1:/# btrfstune -s /dev/zram0
Seeding flag is currently set
rapido1:/# mount /dev/zram0 /mnt/test/
mount: /dev/zram0 is write-protected, mounting read-only
....
rapido1:/# btrfs device add -f /dev/zram1 /mnt/test/
[   77.805374] BTRFS info (device zram0): disk added /dev/zram1
rapido1:/# umount /mnt/test/
rapido1:/# btrfstune -s /dev/zram1
Seeding flag is currently unset
rapido1:/# btrfstune -s /dev/zram0
Seeding flag is currently set

Cheers, David

Reply via email to