Bug 98949 - Filesystem locks not released
Summary: Filesystem locks not released
Status: RESOLVED DUPLICATE of bug 94152
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-29 08:54 UTC by Christophe Lyon
Modified: 2016-05-25 19:39 UTC (History)
2 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 Christophe Lyon 2016-03-29 08:54:04 UTC
Hi,


I've noticed locking problems when I want to open LO files stored on my Synology NAS, exported via NFS. I run LO from Linux Ubuntu clients (15.10).

When trying to open a file on the NFS server, LO shows an error message (after about 30 seconds, probably a timeout) and proposes to open the file read-only or to open a copy.

I "solved" the problem by rebooting the NAS, but it re-occurs after some time.

I've just given a quick look at LO sources, and noticed that in sal/osl/unx/file.cxx (openFilePath), locks are acquired using fcntl(F_WRLCK), but I couldn't find code to unlock the file.

There is support to unlock files in sal/osl/unx/profile.cxx (OslProfile_lockFile), but I don't know if it's actually used.

My assumption is that LO could keep acquiring locks, never releasing them, until the NAS is out of resources.

I ran:
$ strace -f soffice /path/to/nfs/file |& grep LK
[pid 19093] fcntl(14, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19093] fcntl(14, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19093] fcntl(29, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0} <unfinished ...>
[pid 19093] fcntl(35, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19093] fcntl(35, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19093] fcntl(35, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19093] fcntl(42, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19093] fcntl(42, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19096] fcntl(43, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
[pid 19107] fcntl(14, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0

I only opened the file, then quit LibreOffice.

As you can see several locks are acquired, but none is released, possibly leading to resource exhaustion.

I've updated bug #75488 which seems similar, but I'm not sure it got any attention.
Comment 1 Buovjaga 2016-04-07 10:46:54 UTC

*** This bug has been marked as a duplicate of bug 94152 ***
Comment 2 Christophe Lyon 2016-05-25 19:39:13 UTC Comment hidden (no-value)
Comment 3 Christophe Lyon 2016-05-25 19:39:38 UTC Comment hidden (no-value)