[Samba] File locks not always released (Samba 2.2.8)

Jeremy Allison jra at samba.org
Tue Aug 17 00:28:35 GMT 2004


On Wed, Aug 11, 2004 at 03:18:08PM +1000, Rasjid Wilcox wrote:
> We have the occasional problem that file locks are not always being
> released.  The result is files that insist on being 'read only' (claiming
> that the file is already 'in use') or that cannot be deleted or replaced.
> The problem only happens occasionally, and I have yet to be able to
> determine a pattern.  The problem will usuall resolve itself within 24
> hours, but sometimes it is very inconvenient.
> 
> Firstly, is this a known issue with this version of Samba?  If so, does it
> go away in later versions?
> 
> Secondly, is there a way to 'manually' release a file lock on the server,
> for just a specific file?  (I'm thinking of a command that could be run on
> the samba server itself.)
> 
> Failing that, what about releasing all locks?  Google seems to suggest that:
> Stopping Samba, removing /var/cache/samba/locking.tdb and restarting Samba
> would do that.
> Presumably this would be best to do after everyone has logged out of the
> system?  Is this a reasonable thing to do, or is it likely to break
> something?

Yes this is a reasonable thing to do. There was an issue in handling
the lock database I fixed in 3.0.x recently, this code is similar in
2.2.x so it's possible this is a fixed bug. Your suggestion of a command
to manually release a lock is a good one, I'll look at that for later
releases.

Thanks,

	Jeremy.


More information about the samba mailing list