Bug 13107 - Missing directories with smbv2: with smbv1, they show up
Missing directories with smbv2: with smbv1, they show up
Status: NEW
Product: CifsVFS
Classification: Unclassified
Component: kernel fs
3.x
All All
: P5 normal
: ---
Assigned To: Steve French
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-27 13:31 UTC by Andreas Hasenack
Modified: 2017-10-27 16:23 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Hasenack 2017-10-27 13:31:05 UTC
An ubuntu user filed a bug (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1572132) showing that when he uses the SMB2 protocol to mount a share exported by a windows 7 system, a couple of directories do not show up on the linux side.

I reproduced the issue using a windows 7 vm as the server, and with SMB2 two directories don't show up in the share. If I mount with version SMB1 (can't remember now if I had to explicitly enable smb1 in the windows 7 server), then the missing content shows up just fine.

Here is my test:
Curious indeed. I can reproduce this on xenial mounting a share from a windows 7 enterprise VM:

With vers 2.1 (same with 2.0):
root@nsn7:~# l /c
total 3,0G
drwxr-xr-x 2 andreas andreas 4,0K Jun 12 16:58 .
drwxr-xr-x 33 root root 4,0K Jun 27 15:56 ..
-rwxr-xr-x 1 andreas andreas 24 Jun 10 2009 autoexec.bat
-rwxr-xr-x 1 andreas andreas 10 Jun 10 2009 config.sys
drwxr-xr-x 2 andreas andreas 4,0K Out 23 2013 Documents and Settings
-rwxr-xr-x 1 andreas andreas 3,0G Jun 27 15:45 pagefile.sys
drwxr-xr-x 2 andreas andreas 0 Jul 13 2009 PerfLogs
drwxr-xr-x 2 andreas andreas 0 Jun 12 16:10 ProgramData
dr-xr-xr-x 2 andreas andreas 0 Jun 12 21:05 Program Files
drwxr-xr-x 2 andreas andreas 0 Out 23 2013 Recovery
drwxr-xr-x 2 andreas andreas 0 Nov 26 2014 System Volume Information
dr-xr-xr-x 2 andreas andreas 0 Out 23 2013 Users
drwxr-xr-x 2 andreas andreas 0 Out 23 2013 Wallpaper
drwxr-xr-x 2 andreas andreas 0 Jun 12 16:53 Windows
root@nsn7:~# mount|grep cifs
//10.0.7.128/c on /c type cifs (rw,relatime,vers=2.1,sec=ntlmssp,cache=strict,username=IEUser,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=10.0.7.128,file_mode=0755,dir_mode=0755,nounix,mapposix,rsize=1048576,wsize=1048576,actimeo=1)

Without the vers= parameter we get two extra directories: "Arquivos de Programas RFB" and "$Recycle.Bin":
root@nsn7:~# l /c
total 3,0G
drwxr-xr-x 2 andreas andreas 4,0K Jun 12 16:58 .
drwxr-xr-x 33 root root 4,0K Jun 27 15:56 ..
drwxr-xr-x 2 andreas andreas 0 Jun 12 20:52 Arquivos de Programas RFB
-rwxr-xr-x 1 andreas andreas 24 Jun 10 2009 autoexec.bat
-rwxr-xr-x 1 andreas andreas 10 Jun 10 2009 config.sys
drwxr-xr-x 2 andreas andreas 0 Jul 14 2009 Documents and Settings
-rwxr-xr-x 1 andreas andreas 3,0G Jun 27 15:45 pagefile.sys
drwxr-xr-x 2 andreas andreas 0 Jul 13 2009 PerfLogs
drwxr-xr-x 2 andreas andreas 0 Jun 12 16:10 ProgramData
dr-xr-xr-x 2 andreas andreas 0 Jun 12 21:05 Program Files
drwxr-xr-x 2 andreas andreas 0 Out 23 2013 Recovery
drwxr-xr-x 2 andreas andreas 0 Out 23 2013 $Recycle.Bin
drwxr-xr-x 2 andreas andreas 0 Nov 26 2014 System Volume Information
dr-xr-xr-x 2 andreas andreas 0 Out 23 2013 Users
drwxr-xr-x 2 andreas andreas 0 Out 23 2013 Wallpaper
drwxr-xr-x 2 andreas andreas 0 Jun 12 16:53 Windows
# mount|grep cifs
//10.0.7.128/c on /c type cifs (rw,relatime,vers=1.0,cache=strict,username=IEUser,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=10.0.7.128,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,actimeo=1)

I also enabled debugging, like this:
echo 1 > /proc/fs/cifs/traceSMB

That showed that the missing files/directories are sent to the client when "ls -l /mountpoint" is issued.


Finally, the moment I created another entry on C:\, one of the missing directories showed up on the linux side.

cifs-utils 6.4

Users reported this still happening with kernel 4.12.0
Comment 1 Andreas Hasenack 2017-10-27 13:31:42 UTC
Also, smbclient sees all files and directories without problems.