Ticket #3987 (closed defect: invalid)

Opened 4 months ago

Last modified 8 days ago

Midnight Commander loses content of the current directory

Reported by: memy Owned by:
Priority: major Milestone:
Component: mc-vfs Version: master
Keywords: Cc:
Blocked By: #1 Blocking:
Branch state: no branch Votes for changeset:

Description

When I am browsing a mounted SMB directory Midnight Commander sometimes loses directory content.
When I hit Ctrl-r the content of the directory reappears.

It started today after upgrading of the kernel and samba.
All other means of browsing file system work perfectly fine: shell, Thunar, File Open dialogs, etc.
I have shares mounted on different servers:

  1. Synology NAS
  2. Raspberry Pi 4.19.42-1-ARCH #1 SMP PREEMPT Wed May 15 00:39:47 UTC 2019 armv7l GNU/Linux
  3. Dell mini 5.1.2-arch1-1-ARCH #1 SMP PREEMPT Wed May 15 00:09:47 UTC 2019 x86_64 GNU/Linux

MC demonstrates the same behavior on all of the shares.

When I browse to a directory on a mounted SMB share MC occasionally shows empty directory. Re-read immediately restores the panel. The same happens when I am returning back to the parent directory.

The shares are mounted at boot time using systemd like this but the problem persists with any other way of mounting the SMB share:

[Unit]
Description=Mount Share at boot
Requires=network-online.target
After=network-online.target
Wants=network-online.target

[Mount]
What=//host/share
Where=/mnt/SMB/share
Options=uid=<my-uid>,credentials=/home/username/secret.txt,iocharset=utf8,rw,x-systemd.automount
Type=cifs
TimeoutSec=30

[Install]
WantedBy=multi-user.target

I run Arch Linux.
Kernel version: 5.1.2-arch1-1-ARCH #1 SMP PREEMPT Wed May 15 00:09:47 UTC 2019 x86_64 GNU/Linux
samba version: 4.10.3-1 upgraded from 4.10.2-1

LC_MESSAGES=C mc -V

GNU Midnight Commander 4.8.22
Built with GLib 2.58.3
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

LC_MESSAGES=C mc -F

Home directory: /home/username
Profile root directory: /home/username

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

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

mc --configure-options

 '--prefix=/usr' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--enable-vfs-smb' '--with-screen=slang' '--with-x' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'

Change History

comment:1 Changed 4 months ago by andrew_b

  • Component changed from mc-core to mc-vfs
  • Blocked By 1 added

comment:2 Changed 4 months ago by memy

Something interesting happened.
I continued experimenting and all of the sudden everything started to work as expected.
I immediately opened another instance of MC in a new terminal. That new instance did not work though.
So now I have two instances side by side and one of them works consistently while another occasionally shows me empty directory.
I am doing very simple test. I have "Lynx-like motion" option turned on, so I constantly pressing left and right arrow keys.
One instance of MC works as a clockwork, while another shows empty directory from time to time.
Unfortunately I don't know what "fixed" the first instance. I tried to repeat in the second instance the actions I remember doing in the first one, but the second instance continues to fail.

comment:3 Changed 4 months ago by ravenexp

I have the same problem with SMB shares mounted via systemd mount units.
It also happened after the recent kernel and samba updates.

Other file managers like Gnome Nautilus do not suffer from this issue.

comment:4 Changed 4 months ago by memy

After downgrading linux kernel to 5.0.13 everything went back to normal.

comment:5 Changed 9 days ago by andrew_b

  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone Future Releases deleted

comment:6 Changed 8 days ago by memy

I wonder why this ticket has been closed?
The problem still persists while running Linux 5.1+
This is obviously a MC bug, because all other ways to get directory content work flawlessly (ls, other file managers, open and save dialogs, etc).
Also, "Blocked By" field may be incorrect. I am using SMB shares mounted by systemd/mount, not SMB links so I suspect that built-in SMB library has nothing to do with the problem.

Please advise how could I provide more information to help with bug triaging.

The problem is really annoying, I have to hit Ctrl-r almost every time I descend to a folder.

Note: See TracTickets for help on using tickets.