Problem with DELETE_ON_CLOSE open_file_ntcreate()?

Todd Stecher todd.stecher at isilon.com
Tue Jun 19 17:51:04 GMT 2007


We're running 3.0.24.

Here's the scenario:

*	A file exists on our share
* 	An XP client opens the file:
	CreateFile(file, DELETE, 0, NULL, OPEN_EXISTING, DELETE_ON_CLOSE)  
api) with DELETE_ON_CLOSE (only 1 opener of file)

* 	The file handle is closed, the file is NOT deleted.

This same series of steps succeeds on Windows (e.g. file is deleted  
when handle is closed).  It also used to work on our old 3.0.11  
distribution.  I debugged it, and it appears as if the  
FILE_DELETE_ON_CLOSE flag is not setting the fsp- 
 >initial_delete_on_close, or lock->delete_on_close appropriately for  
existing files:


reply_ntcreateX: flags = 0x10, access_mask = 0x110080 file_attributes  
= 0x0, share_access = 0x0, create_disposition = 0x1 create_options =  
0x1000 root_dir_fid = 0x0

parse_share_modes: delete_on_close: 0, initial_delete_on_close: 0,  
num_share_modes: 1
parse_share_modes: share_mode_entry[0]:  pid = 28233, share_access =  
0x0, private_options = 0x1000, access_mask = 0x110080, mid = 0x0,  
type= 0x10, file_id = 1, uid = 10000, dev = 0x22c1fb52, inode =  
4295229443, snapid = -1


I'm hesitant to "fix" this (e.g. set the lock->delete_on_close bit  
when we see the FILE_DELETE_ON_CLOSE option), because there might be  
some subtlety I'm missing here.  It also appears that Jeremy's been  
doing a lot of work in this area (so maybe its a TODO?).  Upgrading  
to a newer version of Samba is not an option, but if there's a one  
line fix I'm missing, that'd be great.  If its just an oversite, I'll  
submit a patch.

Thanks!

Todd




Todd Stecher | Windows Interop Dev
Isilon Systems    P +1-206-315-7500     F  +1-206-315-7501
www.isilon.com    D +1-206-315-7638    M +1-425-205-1180





More information about the samba-technical mailing list