Bug 91621

Summary: mount.cifs with vers=2.0 or higher: blocking file system operations
Product: File System Reporter: Till Schäfer (till2.schaefer)
Component: CIFSAssignee: fs_samba-smb
Status: NEW ---    
Severity: normal CC: bugzilla, elliot.li.tech, linuxkernel.severach, szg00000
Priority: P1    
Hardware: All   
OS: Linux   
URL: https://bugzilla.samba.org/show_bug.cgi?id=13252
Kernel Version: 4.18.8 (gentoo sources) Subsystem:
Regression: No Bisected commit-id:

Description Till Schäfer 2015-01-20 15:22:37 UTC
When i mount a samba share with vers=2.0, 2.1 or 3.0 the file system behavior become very unresponsive. It seems like the file system is waiting for all other operations to complete before the current operation starts. Like all access is serialized for complete operations (i.e. copying a complete file, not only some blocks). This is especially noticeable on slow network connections (i have mounted the samba share over a vpn with 1MiB/s bandwidth and about 35msec rtt).


Example: I start copying a folder containing several larger files from the samba share to a local hard drive. The copy process of the first file starts. After this, i cd in a directory that lies on the samba share (in another terminal). This cd only returns after the complete first file is copied. 

exact mount command used:
mount -t cifs -o vers=3.0,credentials=/somedir/somefile,uid=xxxxx,nosetuids,iocharset=utf8 //server/share /mnt/temp/


If i use vers=1.0 the problems are gone. The operations are slow (while copying a file) but interleaving. 

The problem was reproduced using samba 3.6.24 (only vers=2.0) and 4.1.15 on the server side.
Comment 1 Till Schäfer 2015-01-20 15:26:41 UTC
one further notice: i have tested with cache=none because it thought it might be related to opportunistic locking, but with NO success.
Comment 2 Till Schäfer 2017-12-20 20:14:02 UTC
Now, since vers=3.0 has become the standard: this is still valid for kernel 4.14.8
Comment 3 Chris Severance 2018-02-21 10:03:37 UTC
https://bugzilla.samba.org/show_bug.cgi?id=13252
Comment 4 Till Schäfer 2018-02-21 12:46:17 UTC
possible duplicate: https://bugzilla.kernel.org/show_bug.cgi?id=198349
Comment 5 Steve 2018-04-25 16:05:12 UTC
No one cares? Samba is almost unusable with this bug.
Comment 6 Till Schäfer 2020-02-26 13:16:19 UTC
I think this one is related to wsize and rsize. The default values increased from 64k (vers=1.0) to 4M (kernel > 4.20, vers>=2.1). When I lower that value to 64k again the behaviour of a mount with vers=3.1.1. matches the one of vers=1.0. 

What bothers me is that the delay until a mount reacts on new commands seems to be a multitude of the wsize / bsize.