Bug 91621 - mount.cifs with vers=2.0 or higher: blocking file system operations
Summary: mount.cifs with vers=2.0 or higher: blocking file system operations
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: CIFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_samba-smb
URL: https://bugzilla.samba.org/show_bug.c...
Depends on:
Reported: 2015-01-20 15:22 UTC by Till Schäfer
Modified: 2020-02-26 13:16 UTC (History)
4 users (show)

See Also:
Kernel Version: 4.18.8 (gentoo sources)
Tree: Mainline
Regression: No


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
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.

Note You need to log in before you can comment on or make changes to this bug.