Bug 425614

Summary: Wrong disk space check when copying/moving a file through a symlink in another partition
Product: [Frameworks and Libraries] frameworks-kio Reporter: Davide Gianforte <davide>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 5.72.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Davide Gianforte 2020-08-20 19:46:37 UTC
SUMMARY

When copying (or moving) a file bigger than the free space on the source partition through a symlink to another partition with enough space, the operation fails saying that there is no space on the disk to write the file.

This not happens if the operation involves more than one file, regardless of the position in the QList.

STEPS TO REPRODUCE
1. Have a partition (ext4) at ~/work with 2 GB free with a 16GB file and a small file (few bytes)
2. Have a second partition (ext4) at ~/build with 18GB free
3. Make a symlink (relative) ~/work/build pointing to ~/build (ln -s ../build)

OBSERVED RESULT

Copy the big file from ~/work to ~/work/build, got the error.
Copy the big file from ~/work to ~/build (without using the symlink), no error.
Copy the big file with the small file from ~/work to ~/work/build, no error.


EXPECTED RESULT

The file is copied as the destination partition has enough space.



Operating System: Slackware 14.2
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.72.0
Qt Version: 5.15.0