Summary: | Data loss on remote mount when using rmdir in terminal | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kiofuse | Reporter: | Evan 'JabberWokky' Edwards <evan+kdebugs> |
Component: | general | Assignee: | Fabian Vogt <fabian> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | fabian, kfm-devel, kio-bugs-null, nate, nicolas.fella |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Kubuntu | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/system/kio-fuse/-/commit/830f5cb4784a2e584bbfadeabe93410f0005205c | Version Fixed In: | |
Sentry Crash Report: |
Description
Evan 'JabberWokky' Edwards
2024-03-08 18:04:04 UTC
I'm assuming you're using the sftp:// url in dolphin while the terminal sees the kio-fuse mount, e.g. /run/user/1000/kio-fuse.... Can you post a screenshot of such a situation for clarity? > 1. If a remote directory is not explored, it appears empty within the filesystem (displaying 0 items in the panel) Do you mean the terminal panel or the dolphin panel? It's intentional that directories are not populated unless necessary to avoid potentially slow network requests. > 2. If you then use `rmdir *` in the terminal to clear empty directories, leaving those that have files, the remote mounted filesystem has the same structure, so rmdir dutifully removes all directories including all files. rmdir is supposed to fail on nonempty directories, so the question is which layer is wrong here. kio-fuse translates the rmdir call on directories to KIO::del, unless it already knows that it has items. KIO::del appears to do a recursive deletion by default, which is wrong in this context. For directories, KIO::rmdir is probably more appropriate. A possibly relevant merge request was started @ https://invent.kde.org/system/kio-fuse/-/merge_requests/77 Data loss bugs are Critical; see https://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Bug_triaging#Set_the_Severity_field Resetting severity. (In reply to Fabian Vogt from comment #1) > I'm assuming you're using the sftp:// url in dolphin while the terminal sees > the kio-fuse mount, e.g. /run/user/1000/kio-fuse.... > Can you post a screenshot of such a situation for clarity? This is accurate. I will post a screenshot shortly. > > 1. If a remote directory is not explored, it appears empty within the filesystem (displaying 0 items in the panel) > > Do you mean the terminal panel or the dolphin panel? It's intentional that > directories are not populated unless necessary to avoid potentially slow > network requests. I mean the dolphin view of the filesystem -- the Details View Mode. I realize now that I am assuming without evidence that it displaying "0 items" under size is related to the behavior in the terminal panel. I have no direct reason to know that the two are related, and I completely understand why directory contents are not scanned until opened on remote filesystems. > rmdir is supposed to fail on nonempty directories, so the question is which > layer is wrong here. kio-fuse translates the rmdir call on directories to > KIO::del, unless it already knows that it has items. KIO::del appears to do > a recursive deletion by default, which is wrong in this context. For > directories, KIO::rmdir is probably more appropriate. This makes sense to me. I do not know fuse (other than as a user), and I may have erroneously assumed the error was related to presenting a empty directory within the mount. Thank you all for a prompt response; I've been using KDE since prior to the release of KDE 1.0, and I have always appreciated the work everybody has done and will do. I will take screenshots and any other requested documentation in the next couple hours when I am able to do so. Git commit 830f5cb4784a2e584bbfadeabe93410f0005205c by Fabian Vogt. Committed on 08/03/2024 at 21:29. Pushed by asaoutkin into branch 'master'. Use KIO::rmdir for unlinking directories Unlike KIO::del, this fails if the directory is not empty. M +5 -3 kiofusevfs.cpp M +22 -0 tests/fileopstest.cpp https://invent.kde.org/system/kio-fuse/-/commit/830f5cb4784a2e584bbfadeabe93410f0005205c |