Bug 193964

Summary: F_WRLCK flock on samba mount disallows reads from other fds
Product: [Fedora] Fedora Reporter: Bertrand <hello>
Component: sambaAssignee: Simo Sorce <ssorce>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: caolanm, jplans
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-14 15:01:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
essai1 file
none
essai2 file
none
simple lock test none

Description Bertrand 2006-06-03 13:50:29 UTC
Description of problem:
I have FC5 running on a laptop & a server with samba running. When I try to
create a link between 2 calc files on the server, it does not work (it use to
work without problem on FC3)

Version-Release number of selected component (if applicable):
Lastest rpm package updated thru YUM.
Group        : Applications/Productivity
Source       : openoffice.org-2.0.2-5.12.2.src.rpm
Build Time   : Tue May 23 20:40:29 2006
Install Time : Tue May 30 12:42:32 2006
License      : LGPL

How reproducible: ALWAYS

Steps to Reproduce:
1. create on the laptop 2 spreadsheets: essai1.ods & essai2.ods
2. save them to the server thru the samba drive
3. keep both docs opened and from essai1 try to link to a cell on essai2
4. the result is '#NOM ?' (i have a french version, in English it must be #NAME ?)
-> the link is not created
If the files are located on the laptop, the link is created.
  
Actual results:


Expected results:


Additional info:

Comment 1 Caolan McNamara 2006-06-03 14:30:34 UTC
What is the text of the formula that gives "#NOM ?", i.e. click on it and copy
and paste the text that appears in the formula editor e.g. is it something like

='file:///home/caolan/Documents/test.ods'#$Sheet1.A9
or something like
='smb:///home/caolan/Documents/test.ods'#$Sheet1.A9

Comment 2 Bertrand 2006-06-03 17:05:55 UTC
Here is the text :
='file:///mnt/serveur/aaa/essai2.ods'#feuille1.b5

I will also attach my 2 files essai1 & essai2

Comment 3 Bertrand 2006-06-03 17:07:35 UTC
Created attachment 130451 [details]
essai1 file

Comment 4 Bertrand 2006-06-03 17:08:22 UTC
Created attachment 130452 [details]
essai2 file

Comment 5 Bertrand 2006-06-03 17:28:03 UTC
I have done other tests and it might be linked to capital letters. My folder
"/mnt/serveur/aaa" is in fact "/mnt/serveur/AAA" and it might be the reason why
he cannot create the link.
If i save a new set of essai1 & 2 files into a new folder called
"/mnt/serveur/bbb" (no capital letter) the problem disappear.


Comment 6 Bertrand 2006-06-19 07:37:38 UTC
This issue is very annoying. Can I do anything to help you to solve it ?

Comment 7 Caolan McNamara 2006-06-26 09:36:12 UTC
I wasn't able to reproduce this, but what are the details of the samba server,
is it windows or samba itself. and when you type "mount" on the client, what is
the line for /mnt/serveur, perhaps some casemapping option is being used, or not
being used.

Comment 8 Bertrand 2006-06-26 10:51:06 UTC
The samba server works on a FC5 server. His config file is :
************* /etc/smb.conf
# Samba config file created using SWAT
[global]
	workgroup = MYGROUP
	netbios name = SAMBA
	server string = Samba Server
	log file = /var/log/samba/%m.log
	max log size = 1000
	ldap ssl = no
	hosts allow = 127.0.0.1, 192.168.0.
	hosts deny = all

[homes]
	comment = Home Directories
	read only = No
****************
On the laptop (running also FC5) I mount the server thru /etc/fstab with the
following line :
//192.168.0.4/bg  /mnt/serveur  cifs  rw,uid=bgirin,username=xx,password=xx	0 0
where 192.168.0.4 is the ip address of the server.

Comment 9 Caolan McNamara 2006-07-06 08:36:50 UTC
I can reproduce now, will get onto it

Comment 10 Bertrand 2006-07-06 12:46:26 UTC
Great !

Comment 11 Caolan McNamara 2006-07-06 14:27:55 UTC
Please try this for me...

as root edit the script
/usr/lib/openoffice.org2.0/program/soffice
and change

# file locking now enabled by default
SAL_ENABLE_FILE_LOCKING=1
export SAL_ENABLE_FILE_LOCKING

to be instead

# file locking now enabled by default
#SAL_ENABLE_FILE_LOCKING=1
#export SAL_ENABLE_FILE_LOCKING

i.e. comment those two lines out

and tell me if that "fixes" it



Comment 12 Caolan McNamara 2006-07-06 14:55:54 UTC
Created attachment 132003 [details]
simple lock test

e.g.
./a.out /mnt/serveur/AAA/essai1.ods lock
./a.out /mnt/serveur/AAA/essai1.ods unlock

Comment 13 Caolan McNamara 2006-07-06 15:15:53 UTC
The "case mapping" led me astray, calc makes the text of a failed operation into
lowercase, the problem is simply that once the document has been opened with a
read-write lock over cifs, then it cannot be opened simultaneously and read from.

e.g. 
> oocalc /mnt/serveur/AAA/essai1.ods &
...
> cp /mnt/serveur/AAA/essai1.ods /tmp
Permission denied

Once the cock-up has occured, OOo lowercases the failed text so that's what's
there on save. Presumably if you then close the referred doc, and move it to a
location which is equal to the new wrong string it'll find it again, but that's
neither here nor there.

Comment 14 Caolan McNamara 2006-07-06 15:19:19 UTC
caolanm->fenlason: Is this strict locking a feature or bug ?

Comment 15 Bertrand 2006-07-06 16:30:49 UTC
Coalan,
I have followed your instruction i.e. commenting the 2 lines in
/usr/lib/openoffice.org2.0/program/soffice and that has fixed the bug for me. I
have tried several tests, with different files and all are working now. Thank
you very much for solving this issue !

Comment 16 Simo Sorce 2007-03-14 15:01:27 UTC
This is working as expected, if OpenOffice.org fails to deal properly with
locking I'd say it is an OpenOffice.org bug.

Please Reopen if you have more info that lead to think it is a samba bug instead.