reply_unlink

Nadav Danieli nadavd at exanet.com
Tue Nov 22 17:31:13 GMT 2005


On Tue, 2005-11-22 at 19:06, Jeremy Allison wrote:

> On Tue, Nov 22, 2005 at 06:42:00PM +0200, Nadav Danieli wrote:
> > Hi,
> > 
> > I'm looking at the reply_unlink code and I wonder how it is supposed to
> > work at all.
> > unlink_internals call can_delete and does then call SMB_VFS_UNLINK with
> > no lock or share on the file.
> > Why not simply call open_file_shared1 with delete on close and let close
> > do it?
> 
> Yes that's a race condition, but no worse than other races we live with
> every day. It's a historical artifact. I don't particularly want to
> open the file on disk just to delete it if I can help it as this has
> side effects with existing locks in POSIX.
> 
> Jeremy.

The open is done anyway, only close_file is called with False, the only
change would be to add DELETE_ON_CLOSE_FLAG to the open_file_ntcreate
call and close_file with True for normal close.
I raised this as I saw smbtorture TORTURE with multi clients fail
consistently and I suspect this to be the reason. It runs fine on
Windows 2003 server.


More information about the samba-technical mailing list