This is actually an update to an earlier question on the General section (https://archlinuxarm.org/forum/viewtopic.php?f=57&t=15426), but since I can now express it in clearer terms and since it didn't get any nibbles there I've decided to post it here as a new topic.
To summarize: A CIFS share on a Windows host mounts with no problem but becomes inaccessible after about 20 minutes. Yet it remains accessible using smbclient.
One of the solutions I've tried is using systemd automount instead of mounting the share at boot. The line I use in fstab is as follows:
$this->bbcode_second_pass_code('', '//xxx.xxx.x.xx/test /mnt/test cifs credentials=/home/alarm/.smbcredentials,vers=2.0,noauto,x-systemd.automount,x-systemd.idle-timeout=1min,x-systemd.mount-timeout=30,_netdev')
Now the share stays available. The mount times out after one minute and the share automounts as soon as I do ls /mnt/test. This works for entire days and even after the Windows host goes into standby and then resumes. If I put the host into standby while the share is mounted, systemd reports that the timeout has timed out and unmounts the share on its own.
Once the Windows PC has resumed, the share mounts again instantaneously. BUT as soon as I cd into the actual share mount directory (/mnt/test) the same behavior returns: After 20 minutes or so the share becomes inaccessible. The output of systemctl status mnt-test.mount shows that the share has not auto-unmounted. Presumably just being in the mount directory makes it "not idle" and it is now "permanently mounted" as when I mounted it at boot. And the behavior is the same: If I ls there is a delay and then the error: $this->bbcode_second_pass_code('', 'cannot open directory '.': Host is down') (or sometimes "cannot access '/mnt/Work': No such device.").
/proc/fs/cifs/Stats.txt shows:
$this->bbcode_second_pass_code('', 'Max requests in flight: 3
1) \\192.168.0.32\Work DISCONNECTED ')
BUT the share remains accessible with smbclient.
Logic tells me that the CIFS VFS has flagged the Windows host as "Down" when it isn't. I can now strace and trace network activity from both the Linux and the Windows box, but I don't know what to capture or how to interpret the results.
Any help would be appreciated.
TIA
Arch Linux ARM version 5.7.2-1-ARCH
- samba v 4.12.3
- cifs-utils v 2.26
- mount.cifs v 6.10
- host: Windows 7 Ultimate with SMB1 disabled and SMB2 enabled