Bug 415512

Summary: Krusader fails to copy files to "full" btrfs filesystem but with enough unallocated space
Product: [Frameworks and Libraries] frameworks-kio Reporter: linux2019
Component: generalAssignee: David Faure <faure>
Status: REPORTED ---    
Severity: normal CC: davide, kdelibs-bugs, krusader-bugs-null
Priority: NOR    
Version: 5.65.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description linux2019 2019-12-24 01:39:56 UTC
SUMMARY
Krusader fails to copy file to a btrfs filesystem that reports 0 byte free

STEPS TO REPRODUCE
1. use a btrfs filesystem until metablocks are full on a large disk (example: 8 terabyte filesystem) - it reports 0 bytes free
2. try to copy a file with Krusader that fits on the disk (smaller than unallocated chunks on btrfs)

OBSERVED RESULT
copy fails with popup error message

EXPECTED RESULT
copy is successful

SOFTWARE/OS VERSIONS
Linux: Kernel 5.4.6
KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.65.0
Qt Version: 5.14.0

ADDITIONAL INFORMATION
- Copying files with "cp" on commandline is successful
- btrfs fi usage shows enough unallocated space
- this happened twice on a large disk (8 terabyte) - once at ~4TB unallocated space and now at "almost full"
- Dolphin fails to copy to that btrfs filesystem too

btrfs fi usage output:
Overall:
    Device size:                   7.28TiB
    Device allocated:              7.13TiB
    Device unallocated:          148.00GiB
    Device missing:                7.28TiB
    Used:                          7.13TiB
    Free (estimated):            153.85GiB      (min: 79.85GiB)
    Data ratio:                       1.00
    Metadata ratio:                   2.00
    Global reserve:              512.00MiB      (used: 0.00B)

Data,single: Size:7.12TiB, Used:7.11TiB (99.92%)
Metadata,DUP: Size:8.00GiB, Used:7.78GiB (97.27%)
System,DUP: Size:8.00MiB, Used:784.00KiB (9.57%)
Comment 1 Davide Gianforte 2020-05-01 20:39:57 UTC
Copy operations are handled through KIO (Dolphin is affected too), moving.