Bug 454310

Summary: Cannot show condition of btrfs added device correctly
Product: [Applications] partitionmanager Reporter: Jingyuan Deng <1700011628>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: REPORTED ---    
Severity: normal CC: 1700011628, nate
Priority: NOR    
Version First Reported In: 21.12.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: OBSERVED RESULT when bug occurs

Description Jingyuan Deng 2022-05-24 06:14:34 UTC
Created attachment 149156 [details]
OBSERVED RESULT when bug occurs

SUMMARY

When using `btrfs device add` to add a new partition (I do not try for adding a new device), `partitionmanager` will probably not show condition of added partition correctly, like it cannot show the usage rate of device.
This problem does not always happen. Just keep rebooting and opening `partitionmanager` and sometimes (but rarely) this problem will disappear, but it will still exist after reboot.


STEPS TO REPRODUCE
1. make two BTRFS partitions nad mount one of them in `fstab`
2. `sudo btrfs device add -f /dev/$A $B`, whre `$A` is the path name of the second partition and `$B` is the mounted path of the first partition
3. Open `partitionmanager`, This problem will probably exist. If no, reboot and probably exist. (Like 8 in 10 chance)

OBSERVED RESULT

Like

Partition                     Type        Mount Point     Label            Partition Label      Size                  Used
/dev/nvme0n1p7       btrfs          /home          newhome                                   512.01 GiB           ___
/dev/nvme0n1p6       btrfs       /var/home          newhome                               306.01 GiB           224.07 GiB

EXPECTED RESULT  


Partition                     Type        Mount Point     Label            Partition Label      Size                  Used
/dev/nvme0n1p7       btrfs          /home          newhome                                   512.01 GiB        100.01 GiB
/dev/nvme0n1p6       btrfs       /var/home          newhome                               306.01 GiB         224.07 GiB

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Fedora 35 (Kinoite)
KDE Plasma Version:  5.24.4
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

Update to Fedora36 (Kinoite) does not solve this problem.  That is  `partitionmanager` 21.12.2 and `KDE` 5.24.4, frameworks 5.93.0
Comment 1 Jingyuan Deng 2022-05-24 06:19:17 UTC
Revise:

EXPECTED RESULT  


Partition                     Type        Mount Point     Label            Partition Label      Size                  Used
/dev/nvme0n1p7       btrfs                                    newhome                               512.01 GiB        100.01 GiB
/dev/nvme0n1p6       btrfs       /var/home          newhome                               306.01 GiB         224.07 GiB
Comment 2 Jingyuan Deng 2022-05-24 06:24:21 UTC
EXPECTED RESULT  


Partition                     Type        Mount Point     Label            Partition Label      Size                  Used
/dev/nvme0n1p7       btrfs                                    newhome                               512.01 GiB        108.00 GiB
/dev/nvme0n1p6       btrfs       /var/home          newhome                               306.01 GiB        116.01 GiB

But even if `partitionmanager` mangers to show the usage of /dev/nvme0n1p7, there is

Partition                     Type        Mount Point     Label            Partition Label      Size                  Used
/dev/nvme0n1p7       btrfs                                    newhome                               512.01 GiB        108.00 GiB
/dev/nvme0n1p6       btrfs       /var/home          newhome                               306.01 GiB        224.01 GiB

The usage of nvme0n1p7 is counted twice. (One in /dev/nvme0n1p6 and one in /dev/nvme0n1p7)