Bug 490231

Summary: net-libs/libktorrent test fail if /tmp is on XFS PreallocationTest::testPreallocationMultiFileCache PreallocationTest::testPreallocationSingleFileCache
Product: [Applications] ktorrent Reporter: lg3dx6fd
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: REPORTED ---    
Severity: normal CC: cwo.kde, lg3dx6fd
Priority: NOR    
Version: 23.08.5   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description lg3dx6fd 2024-07-13 14:48:05 UTC
SUMMARY
net-libs/libktorrent fails 2 tests if /tmp is on partition with XFS  : 
PreallocationTest::testPreallocationMultiFileCache PreallocationTest::testPreallocationSingleFileCache

Some logs:
```
from ./preallocation.log :
```
Thu Jul 11 20:32:15 2024: Tot Size : 35858964
Thu Jul 11 20:32:15 2024: Num Chunks : 137
Thu Jul 11 20:32:15 2024: Chunk Size : 262144
Thu Jul 11 20:32:15 2024: Last Size : 207380
Thu Jul 11 20:32:15 2024: Created /tmp/preallocationtest-QKlEmptorrent
Thu Jul 11 20:32:16 2024: Tot Size : 10825048
Thu Jul 11 20:32:16 2024: Num Chunks : 42
Thu Jul 11 20:32:16 2024: Chunk Size : 262144
Thu Jul 11 20:32:16 2024: Last Size : 77144
Thu Jul 11 20:32:16 2024: Created /tmp/preallocationtest-Nuvsdztorrent
Thu Jul 11 20:32:16 2024: Preallocating file /tmp/preallocationtest-QKlEmpdata/movies/aaa.avi (11438415 bytes)
Thu Jul 11 20:32:16 2024: file_size = 0
Thu Jul 11 20:32:16 2024: Preallocating file /tmp/preallocationtest-QKlEmpdata/movies/bbb.avi (9124816 bytes)
Thu Jul 11 20:32:16 2024: file_size = 0
Thu Jul 11 20:32:16 2024: Preallocating file /tmp/preallocationtest-QKlEmpdata/movies/ccc.avi (15295733 bytes)
Thu Jul 11 20:32:16 2024: file_size = 0
Thu Jul 11 20:32:16 2024: PreallocationThread has finished
Thu Jul 11 20:32:16 2024: bw: 0, ts: 35858964
Thu Jul 11 20:32:16 2024: Preallocating file /tmp/preallocationtest-Nuvsdzdata/bla.avi (10825048 bytes)
Thu Jul 11 20:32:16 2024: file_size = 0
Thu Jul 11 20:32:16 2024: PreallocationThread has finished
Thu Jul 11 20:32:16 2024: bw: 0, ts: 10825048
```

The code that produces such is at /var/tmp/portage/net-libs/libktorrent-23.08.5/work/libktorrent-23.08.5/src/diskio/tests/preallocationtest.cpp nearly at 80-90 lines.
```

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo 
(available in About System)
KDE Plasma Version: 5.27.11
KDE Frameworks Version:  5.116.0
Qt Version: 5.15.14

ADDITIONAL INFORMATION
It doesn't fail if /tmp is on ext4, btrfs or tmpfs .

Bug downstream : https://bugs.gentoo.org/934425