Samba and disk quota

Jeremy Allison jeremy at valinux.com
Tue Nov 21 16:00:42 GMT 2000


On Tue, Nov 21, 2000 at 04:30:43PM +1000, Steve Ripps wrote:
> 
> Windows NT workstation 4.0 with service pack 6a.
> 
> When I save a file that goes past my blocks hard limit, windows
> displays a requester saying "Can't save "filename": the Disk is Full".
> I then press F5 to refresh the explorer window and the file is there
> and appears to be the correct size.  Of course it isn't. Any content
> after the blocks hard limit is read as binary zeros.  This is bad.
> 
> Perhaps samba could do something more sensible in this situation?
> Delete the file, or at least set its size to reflect the number
> of bytes actually saved to disk.

This happens because NT sets the size of the file *first*,
which under POSIX succeeds as it doesn't reserve any disk 
space (sparse file), then it does the writes. A possible
solution would be for smbd to truncate the file size at
the current offset if a write fails with "disk full". I'll
look into this for 2.2 and HEAD.

As NT doesn't seem to properly support sparse files (a seek
and write beyond the end of file always allocates the disk
blocks) this may be a solution. Comments anyone ?

Thanks,

		Jeremy Allison,
		Samba Team.



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




More information about the samba mailing list