Summary: | kf5.kio.trash stats thousands of files in ~/.local/share/Trash/files | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Björn Lindqvist <bjourne> |
Component: | Trash | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | a.samirh78, kdelibs-bugs, meven.car, meven29, nate |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/kio/commit/73cc5a82de887b197ddfd35e0dce3d1a34d5eb47 | Version Fixed In: | 5.72 |
Sentry Crash Report: |
Description
Björn Lindqvist
2020-05-28 16:13:18 UTC
The records are kept because IIUC users are supposed to be able to restore deleted files from the Trash. Examine ~/.local/share/Trash/info/* and ~/.local/share/Trash/directorysizes I don't think this is a bug, you basically deleted the files in the Trash, without telling kio_trash about it... :) (In reply to Ahmad Samir from comment #1) > The records are kept because IIUC users are supposed to be able to restore > deleted files from the Trash. Exact > > Examine ~/.local/share/Trash/info/* and ~/.local/share/Trash/directorysizes > > I don't think this is a bug, you basically deleted the files in the Trash, > without telling kio_trash about it... :) Still we tru to dectect orhpaned files such as here where we have the metadata but not the files. Your bug shows it does not clean its record, once it has noticed the files are orphaned, since this repeats or at least not correctly. (In reply to Méven Car from comment #2) [..] > > Still we tru to dectect orhpaned files such as here where we have the > metadata but not the files. Your bug shows it does not clean its record, > once it has noticed the files are orphaned, since this repeats or at least > not correctly. Good point, non-existing files should indeed be removed from the Trash records/info. Git commit 73cc5a82de887b197ddfd35e0dce3d1a34d5eb47 by Méven Car, on behalf of Ahmad Samir. Committed on 16/06/2020 at 08:59. Pushed by meven into branch 'master'. [Trash] Remove trashinfo files referencing files/dirs that don't exist If the user moves a file to trash, the deletes that file without using kio_trash (e.g. with rm), then the relevant trashinfo file should be deleted the next time we try to list/stat that trashed file; otherwise kio_trash keep trying to stat that file every time the Trash dir is stat'ed/listed. The testtrash unit test still passes. Thanks to meven for pointing out how to fix this bug. FIXED-IN: 5.72 M +2 -1 src/ioslaves/trash/kio_trash.cpp M +24 -0 src/ioslaves/trash/tests/testtrash.cpp M +1 -0 src/ioslaves/trash/tests/testtrash.h https://invent.kde.org/frameworks/kio/commit/73cc5a82de887b197ddfd35e0dce3d1a34d5eb47 |