Koozali.org: home of the SME Server

Office 2013 and samba shares : locking files problem

Offline jibe

  • ***
  • 128
  • +0/-0
Office 2013 and samba shares : locking files problem
« on: October 30, 2015, 11:34:43 AM »
Hi,

In a network made of a SME 8.1 server (up-to-date) and some W7 workstations, I have some problems with filesharing under Office 2013. The documents are in a shared folder of an ibay. When one is used by any version of MS Office, included 2013, the file is well locked for others if they use MS Office <= 2010. But users of MS Office 2013 seem to not see the lock, and can open the file as if it was not already open on another workstation.

Did somebody already had this problem ? What could happen ?

I don't see anything mentioned on the web about this problem, so it seems to happen only in some particular cases... Is it the association of Office 2013 and the way that samba shares are configured on SME 8.1 ?

In the smb.conf of SME, I see that there is, in the [general] section :
Code: [Select]
oplocks = true
kernel oplocks = true
level2 oplocks = true

strict locking = no

Could it be a solution to change strict locking to yes ? Is there big risks to do that on a prod server ? (I don't use Windows personnaly, so I should be obliged to install 2 VM windows to test it safely...)

guest22

Re: Office 2013 and samba shares : locking files problem
« Reply #1 on: October 30, 2015, 12:25:08 PM »
I believe this was discussed before on the bug tracker...

Offline jibe

  • ***
  • 128
  • +0/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #2 on: October 30, 2015, 11:10:00 PM »
Thanks for this information. It was hard to find, but I suppose that you are talking about bug#8626 ?

It's almost the reverse case ! The bug is about a lock message when saving a not already opened file, when I have no lock message when opening an already opened file !

So, I hesitate... They suggest to disable oplocks, but it seems to me more logic to set strict locking to yes... However, I'm not very expert about samba shares and would appreciate more advices or explanations.

Thanks.

Offline jibe

  • ***
  • 128
  • +0/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #3 on: November 06, 2015, 01:59:24 PM »
Hi,

I tried first to disable oplocks, as it seems to have less secondary effects that anything else. And it was the solution, even if the case is very different than the one described in bugzilla...

Thanks.


Offline mike_mattos

  • *
  • 313
  • +0/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #4 on: December 02, 2015, 04:24:05 AM »
In October, I had multiple sites with oplock issues.  No cause ever found, and not related to server loads, it could happen at 04:00 with idle sessions that had files left open since quitting time!   In November they just stopped happening.

Looked in /var/log/samba/old , sorted by date, on one server 8 entries ( stations reporting ) in Oct 2015, 13 for the first 9 months of the year , NONE in November

...

Offline purvis

  • ****
  • 567
  • +0/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #5 on: January 14, 2016, 12:37:33 AM »
You might want to try monitoring opened files and the lock flag using  filesopenloop.php at
http://forums.contribs.org/index.php/topic,47424.msg234084.html#msg234084

Offline mike_mattos

  • *
  • 313
  • +0/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #6 on: January 14, 2016, 12:42:20 AM »
The errors were on random files at random times, like Samba had just taken a nap!
...

Offline purvis

  • ****
  • 567
  • +0/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #7 on: January 14, 2016, 03:40:46 AM »
Sound like record locking for sure was not taking place.
You might want to back down to SMB1

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #8 on: January 14, 2016, 10:31:30 AM »
You might want to back down to SMB1

would you mind to elaborate a bit? thank you

Offline purvis

  • ****
  • 567
  • +0/-0
Re: Office 2013 and samba shares : locking files problem
« Reply #9 on: January 24, 2016, 01:44:34 AM »
If there is a problem that comes from using different versions of SMB.
I suggest reading up the different versions of SMB.
Specially the part on opportunistic file locking.
As far as I know. SMB1 is the only version where you can turn off opportunities file locking on a windows client.
I suggest doing that first in testing when files are being shared by different clients,and there are issues.
Then if it solves the issues, you might be able to make adjustments in samba(sme's SMB) to fine tune the features of samba including the version of SMB used and/or the shared directories and files being used with the veto feature available in the samba software on the sme server.

As far as I know, there is no feature on a windows client to act like the veto features of samba.
When a file is shared using the SMB protocol. The program that is opening and using the file can be written to not cache the file locally on the windows client. But the user of the software usually has no control of that option and it is hard coded in a program.

Where files are being shared on a server using Windows clients and the protocol is SMB.
I highly suggest learning about ways of find out which files on a server are open and being shared and in what mode the file is being shared.

This might get some started.
https://social.msdn.microsoft.com/Forums/en-US/803f7914-6acc-4037-9238-febb3c9d54db/how-the-file-sharing-modes-work-in-windows-file-sharingsmb?forum=os_fileservices
« Last Edit: January 24, 2016, 01:56:46 AM by purvis »