Ticket #4454 (closed defect: wontfix)

Opened 20 months ago

Last modified 20 months ago

Not all files shown on drvfs volume in WSL2 if getdents64 returns an offset

Reported by: pasiasty Owned by:
Priority: major Milestone:
Component: mc-core Version: 4.8.27
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Conditions

I have observed the issue only on drvfs volumes in WSL2 - Ubuntu.

Description

If a directory contains more that a few hundred of files, not all are shown. Using strace I have determined that output of first getdents64 is ignored.

MC version

GNU Midnight Commander 4.8.27
Built with GLib 2.68.4
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor and Aspell support
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
With ext2fs attributes support
Virtual File Systems:

cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, fish

Data types:

char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

guest OS version

bookworm/sid

WSL2 and host OS version

WSL version: 1.1.6.0
Kernel version: 5.15.90.1
WSLg version: 1.0.50
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.1485

virtual filesystem

drvfs on /mnt/d type 9p (rw,noatime,dirsync,aname=drvfs;path=D:\;uid=1000;gid=1000;metadata;umask=22;fmask=11;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)

underlying filesystem

NTFS

Steps to reproduce

  1. install Ubuntu in WSL2 on Windows 11
  2. in Ubuntu console run:
    sudo apt update
    sudo apt upgrade
    sudo apt install mc
    cd /mnt/c/Users/<your windows account name>
    mkdir mc_test
    for ((i=1; i<=1025; i++ )) ; do touch "`printf %05d $i`" ; done
    ls | wc -l  # expected output: 1025
    mc
    

Expected output

MC shows all 1025 files

Actual output

MC shows only files 01023, 01024 and 01025. If you remove these three files, MC shows files 00001 through 1022.

logs

relevant fragment of strace output:

chdir("/mnt/c/users/cezar/mc_test")     = 0
openat(AT_FDCWD, "/mnt/c/users/cezar/mc_test", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 13
newfstatat(13, "", {st_mode=S_IFDIR|0775, st_size=4096, ...}, AT_EMPTY_PATH) = 0
getdents64(13, 0x562bb8c01630 /* 1024 entries */, 32768) = 32752
lseek(13, 0, SEEK_SET)                  = 0
newfstatat(AT_FDCWD, "/mnt/c/users/cezar", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
getdents64(13, 0x562bb8c01630 /* 3 entries */, 32768) = 96
newfstatat(AT_FDCWD, "/mnt/c/users/cezar/mc_test/01023", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(AT_FDCWD, "/mnt/c/users/cezar/mc_test/01024", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(AT_FDCWD, "/mnt/c/users/cezar/mc_test/01025", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
getdents64(13, 0x562bb8c01630 /* 0 entries */, 32768) = 0
pselect6(6, [5], NULL, NULL, {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)
write(1, "\33[2;136H", 8)               = 8
close(13)                               = 0

Change History

comment:1 Changed 20 months ago by andrew_b

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

Window is not supported at all.

comment:2 Changed 20 months ago by pasiasty

I have also checked on Windows 10: MC works ok, all files are shown.

MC version

GNU Midnight Commander 4.8.27
Built with GLib 2.68.4
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor and Aspell support
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
With ext2fs attributes support
Virtual File Systems:

cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, fish

Data types:

char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

WSL and Windows version

Verze WSL: 1.1.3.0
Verze jádra: 5.15.90.1
Verze WSLg: 1.0.49
Verze MSRDC: 1.2.3770
Verze Direct3D: 1.608.2-61064218
Verze DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
verze Windows: 10.0.19045.2788

virtual filesystem

C:\ on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000,umask=22,fmask=11,metadata,case=off)

underlaying filesystem

NTFS

Note: See TracTickets for help on using tickets.