id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
4454	Not all files shown on drvfs volume in WSL2 if getdents64 returns an offset	pasiasty		"== 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
}}}


"	defect	closed	major		mc-core	4.8.27	wontfix					no branch	
