[Samba] File locking problem between Linux and WinXP
chris at spagnet.com
Sat Dec 23 23:31:32 GMT 2006
I'm encountering a nasty file locking problem on my development system.
The base system is WinXP SP2 (call it "Alpha"), on which there is a
shared directory ("D:\Websites") on NTFS. Running in a M$ Virtual
Machine session on Alpha is an Ubuntu Linux (6.06) system, call it
"Beta". Most of the website development is done on Alpha, and Beta gets
spun up to test when I need to test server functionality. Beta has its
own id+pw to access the D:\Websites directory via a mount -t smbfs
Beta has no problem reading the files ... but as soon as it has touched
a file in any way, that file is getting locked so that it can no longer
be written from Alpha OR Beta. E.g. if I make a change to index.html,
look at it in a browser pointed to the Beta server, then try to make
another change to index.html from either system it's locked. This
occurs even if the file is only opened for read, and even if the entire
directory is mounted read-only in Beta.
The lock persists until the WinXP system is rebooted - unmounting within
Beta or even shutting down Beta and the Virtual Machine environment do
not release the lock.
SysInternals HANDLE.EXE utility indicates that the touched files have
open handles in the System process (PID 4) of Alpha.
I'm not sure if this is a problem with the sharing configuration on the
WinXP side, or with smbfs/smbmount on the Linux side. I do know that I
can resolve it by moving all the files into Beta's native filesystem and
sharing that back to WinXP, but that's less than ideal for a lot of
reasons (not the least of which is that I've have to spin up the server
just to look at a file).
________*________ Chris Barnabo, chris at spagnet.com
____________ \_______________/ http://www.spagnet.com
\__________/ / /
__\ \_______/ /__ "The heck with the Prime Directive,
\_______________/(- let's destroy something!"
More information about the samba