Bug 208418

Summary: Data loss moving a folder to a folder without enough free space
Product: [Frameworks and Libraries] kio Reporter: Mancausoft <andreamilazzo>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: finex
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description Mancausoft 2009-09-24 18:34:42 UTC
Version:            (using KDE 4.3.1)
OS:                Linux
Installed from:    Debian testing/unstable Packages

I Move folder to another one without enough free space. when appears a disk full dialog I press AutoSkip. When finish, the source folder and the unmoved file is deleted.
Comment 1 FiNeX 2009-09-26 21:22:12 UTC
Cannot reproduce this bug using current trunk. Someone could confirm it has been fixed? Now the uncopied files are not deleted.
Comment 2 David Faure 2009-09-28 11:14:53 UTC
I'm not aware of such a bug.

There was bug 118593 but it was a bit more complicated (and it got fixed for 4.2.1 anyway).

I assume this was a move from file:///... to file:///... ?
Comment 3 Mancausoft 2009-09-28 14:21:41 UTC
David Faure <faure@kde.org> scrisse:

> There was bug 118593 but it was a bit more complicated (and it got
> fixed for 4.2.1 anyway).
> 
> I assume this was a move from file:///... to file:///... ?

Yes, I move a folder by dolphin or konqueror. If I move a file o more
file  the uncopied files are not deleted, if move a folder yes.


Mancausoft
Comment 4 Mancausoft 2009-09-29 03:35:54 UTC
FiNeX <finex@finex.org> wrote:

> Cannot reproduce this bug using current trunk. Someone could confirm
> it has been fixed? Now the uncopied files are not deleted.

I try now from svn (kde 4.3.69 (KDE 4.4 >= 20090923)) 
revision 1029074 and the bug are present, the uncopied are deleted.
Comment 5 David Faure 2009-10-03 02:06:36 UTC
Confirmed. The files are skipped during copying, and then deleted. Bad.
Comment 6 David Faure 2009-10-05 19:45:10 UTC
SVN commit 1031654 by dfaure:

Repair regression introduced by the optimization "recursive deletion in kio_file".
We should only recurse when asked to (KIO::del()), not when called by KIO::rmdir(),
which -has- to fail if the dir is not empty (like it did before).

Otherwise, after moving a directory failed mid-way due to disk full, we lose the whole
source dir. Whoops.

BUG: 208418


 M  +2 -1      kio/kio/deletejob.cpp  
 M  +2 -2      kio/kio/job.h  
 M  +20 -0     kio/tests/jobtest.cpp  
 M  +2 -0      kio/tests/jobtest.h  
 M  +4 -2      kioslave/file/file_unix.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1031654
Comment 7 David Faure 2009-10-05 23:30:36 UTC
SVN commit 1031744 by dfaure:

Make sure to not even try deleting directories where not all the source files could be moved.
This is safer, and necessary with protocols that cannot implement the "rmdir should give an
error if the dir is not empty".
CCBUG: 208418


 M  +21 -12    copyjob.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1031744
Comment 8 David Faure 2009-10-05 23:45:18 UTC
SVN commit 1031746 by dfaure:

Backport for kde 4.3.3
CCBUG: 208418


 M  +2 -1      kio/kio/deletejob.cpp  
 M  +2 -2      kio/kio/job.h  
 M  +20 -0     kio/tests/jobtest.cpp  
 M  +2 -0      kio/tests/jobtest.h  
 M  +4 -2      kioslave/file/file_unix.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1031746