[Samba] 3.0.24 lock not releasing when file is closed

Jeremy Allison jra at samba.org
Fri May 25 22:30:34 GMT 2007


On Wed, May 02, 2007 at 10:19:23AM +0800, Neil Wright wrote:
> Samba version 3.0.24-4 on a Fedora Core 5 box.
> 
>  
> 
> I've been working solidly on this for the last 2 days but don't seem to be
> getting anywhere.  Any and all help would be greatly appreciated.
> 
>  
> 
> I've found that once a file has been opened, smbstatus shows the file is
> locked as expected (see below)
> 
>  
> 
> Locked files:
> Pid          Uid        DenyMode   Access      R/W        Oplock
> SharePath   Name   Time
> ----------------------------------------------------------------------------
> ----------------------
> 20863        670        DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH
> /data/home/public   New Microsoft Word Document.doc   Tue May  1 22:22:36
> 2007
> 
>  
> 
> Then when the file is then closed the lock stays (see below) for approx 20
> mins before disappearing
> 
>  
> 
> Locked files:
> Pid          Uid        DenyMode   Access      R/W        Oplock
> SharePath   Name   Time
> ----------------------------------------------------------------------------
> ----------------------
> 20863        670        DENY_NONE  0x2019f     RDWR       NONE
> /data/home/public   New Microsoft Word Document.doc   Tue May  1 22:22:36
> 2007
> 
>  
> 
> Now if the user opens the file again they get a message that the file is
> locked for editing by 'another user' and then prompted to open a read-only
> version of the file.  Below is the output of smbstatus showing the file
> locking.

If the client redirector is holding the file open even after the
app has exited (as they sometimes do), the second open with an oplock
break should close it....

Do you have a wireshark/ethereal trace of this ?

Jeremy.


More information about the samba mailing list