More on quotas

Jeremy Allison jeremy at valinux.com
Wed Mar 28 16:19:50 GMT 2001


Jim McDonough wrote:
> 
> On Win2K and NT:
> Find the old file
> See if the new file exists
> open the old file
> create the new file
> set the new file size (transact2 set file info)
> while not finished {
>   read the old file
>   write the new file : breaks on hard error 39
> }
> close the old file
> close the new file
> 
> NT and 2K do not take care of deleting the old file.  If the server is NT
> instead of samba, it issues a zero-byte write at the end of the file to
> test if there is enough room.  This fails, and then it uses a trans2 set
> file info to cause a delete on close.

At what point in the above sequence does it issue the zero
byte write ? Is that the "set the new file size" call you 
mean, or is it before or after that ? This is important,
as I can easily catch this zero size write and cause the
real filesize to be extended - although there's an inherent
race condition w.r.t. other apps extending the file at the
same time.

Jeremy.

-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------




More information about the samba-technical mailing list