Bug 131401 - Document locking on Linux cifs mount blocking files for MSO
Summary: Document locking on Linux cifs mount blocking files for MSO
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.3.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: File-Lock
  Show dependency treegraph
 
Reported: 2020-03-18 11:42 UTC by Massimo B.
Modified: 2023-11-11 09:45 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Massimo B. 2020-03-18 11:42:37 UTC
Opening a file on a cifs mount on Linux from libreoffice-6.3.5.2, some MS Office Professional Plus 2019 fails to open with  "... is currently used by another person. Please try again later."


1. The locking user is not reported on MSO, eventhough both locking files for LO and MSO are created and owned by my user.

2. There is no way to open a read-only copy from MSO. It can't open the file at all.
Comment 1 Samuel Mehrbrodt (allotropia) 2020-03-18 14:14:28 UTC
(In reply to Massimo B. from comment #0)
> Opening a file on a cifs mount on Linux from libreoffice-6.3.5.2, some MS
> Office Professional Plus 2019 fails to open with  "... is currently used by
> another person. Please try again later."
> 
> 
> 1. The locking user is not reported on MSO, eventhough both locking files
> for LO and MSO are created and owned by my user.

Is the file still open in LibreOffice while you try that?
Can you try if changing the "UseDocumentSystemFileLocking" option changes the behavior?
Does this work on another file system or is this specific to CIFS?

> 
> 2. There is no way to open a read-only copy from MSO. It can't open the file
> at all.

This is not our bug, please report this issue to Microsoft.
Comment 2 Massimo B. 2020-03-18 14:34:26 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #1)

> Is the file still open in LibreOffice while you try that?

Of course. After closing the file, it is accessible again from MSO.

> Can you try if changing the "UseDocumentSystemFileLocking" option changes
> the behavior?

How and where to do that?
I have enabled Options->Load/Save->Microsoft Office->[x] Create MSO lock file.

> Does this work on another file system or is this specific to CIFS?

I don't have any other shared filesystem with MSO.

> > 2. There is no way to open a read-only copy from MSO. It can't open the file
> > at all.

> This is not our bug, please report this issue to Microsoft.

Because in an MSO environment this is all working, I don't think they appreciate a bug report with 3rd party tools.
Comment 3 QA Administrators 2020-03-19 02:35:57 UTC Comment hidden (obsolete, spam)
Comment 4 Samuel Mehrbrodt (allotropia) 2020-03-19 06:50:19 UTC
(In reply to Massimo B. from comment #2)
> How and where to do that?
> I have enabled Options->Load/Save->Microsoft Office->[x] Create MSO lock
> file.

Tools->Options->Advanced->Open Expert configuration.
Then search for "UseDocumentSystemFileLocking" and change to false.

> 
> > Does this work on another file system or is this specific to CIFS?
> 
> I don't have any other shared filesystem with MSO.

I mean on a local file system like NTFS. Just try on a Windows machine with both LO and MSO installed on the local file system.

> 
> > > 2. There is no way to open a read-only copy from MSO. It can't open the file
> > > at all.
> 
> > This is not our bug, please report this issue to Microsoft.
> 
> Because in an MSO environment this is all working, I don't think they
> appreciate a bug report with 3rd party tools.

Ok.
Comment 5 Massimo B. 2020-03-19 07:19:10 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #4)

> Tools->Options->Advanced->Open Expert configuration.
> Then search for "UseDocumentSystemFileLocking" and change to false.

This makes a difference. Now MSO can open the file as usual and does not get any information about other people having opened that file.
This would not prevent others from changing the file in the background but is currently better here for not blocking other team members.
Is it advised to keep this disabled or does it just point to a bug in Libreoffice?
Comment 6 Samuel Mehrbrodt (allotropia) 2020-03-19 07:35:51 UTC
(In reply to Massimo B. from comment #5)
> (In reply to Samuel Mehrbrodt (CIB) from comment #4)
> 
> > Tools->Options->Advanced->Open Expert configuration.
> > Then search for "UseDocumentSystemFileLocking" and change to false.
> 
> This makes a difference. Now MSO can open the file as usual and does not get
> any information about other people having opened that file.
> This would not prevent others from changing the file in the background but
> is currently better here for not blocking other team members.
> Is it advised to keep this disabled or does it just point to a bug in
> Libreoffice?

The bug might as well be in the CIFS implementation. Not easy to say.
I guess it's safe to disable this setting, as the overwriting is prohibited by the lockfile.

Maybe it even makes sense to disable this setting by default? Looks like it does not work reliably on network shares. See also bug 131388.
Comment 7 EmilyOliver 2021-01-23 07:45:10 UTC Comment hidden (spam)
Comment 8 LuisSipes 2021-01-26 17:10:09 UTC Comment hidden (obsolete, spam)
Comment 9 AlberthaKuhn 2021-01-27 06:07:17 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2023-01-28 03:25:21 UTC Comment hidden (obsolete)
Comment 11 Bjoern Voigt 2023-04-27 17:31:21 UTC
I can confirm this bug with Libreoffice 7.4.6.2.

If UseDocumentSystemFileLocking is false and other locking options are default, then MS Office (tested with Word 365) can open and save documents, which are already opened in Libreoffice (LO). There is no notification both in LO and MS Office, that someone already has opened the file. LO creates a .~lock.originalfilename# lock file, which is ignored by MS Office.

If UseDocumentSystemFileLocking is false and CreateMSOLockFiles is true there is also no notification in MS Office, if the file is already opened in LO. There is a MS Office compatible lock file ~$partoforiginalfilename, but MS Office ignores it.

If UseDocumentSystemFileLocking is true (default), MS Office can not open the document, which is already opened in LO. Copying the file is also impossible in Windows then.