Ticket #4364 (closed defect: fixed)

Opened 2 years ago

Last modified 21 months ago

"Remote I/O error (121)" trying to delete a remote directory containg files.

Reported by: gv Owned by: andrew_b
Priority: major Milestone: 4.8.29
Component: mc-vfs Version: 4.8.27
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description (last modified by andrew_b) (diff)

Description of the problem:
Most of the times I cannot delete directories that have files or others directories on a remote machine (I connect using cd sh://user@host/home/user). I get something like this:

Cannot remove directory "/sh://user@h~home/user/1
                 Remote I/O error (121)
      [ Skip ]  [ Skip all ]  [ Retry ]  [ Abort ]

For most of directories in /home/user it does not work. Occasionally, for some directories, it works. And I cannot find a pattern here.

The only workaround for this issue is to first manually remove files from the directory and then remove the directory itself. This is easy if the directory tree is small. But for sure not feasible for a large directory tree.

Steps to reproduce:

  1. ssh user@host
  2. mkdir 1
  3. copy some random files into directory 1
  4. connect from mc to the remote host using sh://user@host/home/user
  5. try to remove directory 1 by pressing F8 on the directory.
$ mc -V
GNU Midnight Commander 4.8.28
Built with GLib 2.56.4
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor and Aspell support
With optional subshell support
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
$ mc -V
Home directory: /home/user
Profile root directory: /home/user

[System data]
    Config directory: /etc/mc/
    Data directory:   /usr/share/mc/
    File extension handlers: /usr/libexec/mc/ext.d/
    VFS plugins and scripts: /usr/libexec/mc/
        extfs.d:        /usr/libexec/mc/extfs.d/
        fish:           /usr/libexec/mc/fish/

[User data]
    Config directory: /home/user/.config/mc/
    Data directory:   /home/user/.local/share/mc/
        skins:          /home/user/.local/share/mc/skins/
        extfs.d:        /home/user/.local/share/mc/extfs.d/
        fish:           /home/user/.local/share/mc/fish/
        mcedit macros:  /home/user/.local/share/mc/mc.macros
        mcedit external macros: /home/user/.local/share/mc/mcedit/macros.d/macro.*
    Cache directory:  /home/user/.cache/mc/

Thank you!

Change History

comment:1 Changed 21 months ago by andrew_b

  • Status changed from new to accepted
  • Description modified (diff)
  • Version changed from master to 4.8.27
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.29
  • Owner set to andrew_b

Branch: 4364_fish_remove_nonempty_dir

comment:2 Changed 21 months ago by zaytsev

I would add a comment to the source code referencing this ticket to explain why these checks are needed (that is for VFS support). Otherwise, someone will surely optimise it again a decade later ;-)

comment:3 Changed 21 months ago by andrew_b

I'll add a comment to the commit before merge:
readdir() of FISH VFS doesn't return "." and ".." entries.

Last edited 21 months ago by andrew_b (previous) (diff)

comment:4 Changed 21 months ago by zaytsev

Well, I meant the source code, not the commit message. Surely you won't be blaming every line before considering whether to change it or not...

comment:5 Changed 21 months ago by ossi

when something seems obviously wrong, i actually tend to blame it to figure out whether i'm missing something. tough i suppose i may be somewhat exceptional in that regard.

code comments also have the unfortunate habit of going out of sync with reality, so their "cautionary" value tends to be limited in practice.

nonetheless, i agree that they should be added as a matter of best practice.

comment:6 Changed 21 months ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:7 Changed 21 months ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [7bbaa13644c001ffdb900fe6b8460907c23e326b].

git log --pretty=oneline 3a3811c52..7bbaa1364

comment:8 Changed 21 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.