preallocated file size

David Collier-Brown davecb at
Thu Feb 3 16:34:52 GMT 2000

Terry McCoy wrote:
[...] 		t	he file is being created and
> a seek ahead is being done, then the process of coping the
> file over from the client to the server is begun.  Hence a
> method to preallocate disk space for the new file.
>     Why is this being done?
>     Is there an configuration option to turn this behavior off?
>     If it can't be turned off what location(s) in the source is this
>     behavior being implemented.

	It appears to be client-side behavior: it doesn't
	happen with smbclient, so I'll assume it's an idiom
	used on Windows filesystems to get an early failure,
	thus saving the user a long wait just to find out
	that the copy failed...

	Can you tell us what the result is on the Windows side?
	I fear it's: "the program appeared to succeed, but the file
	is silently truncated if there isn't enough disk space". 
	That would be bad (;-)).  If it is, can you tell us what
	programs suffer from it?

	Possible workaround: controlled by an option, set a
	per-fd flag on open saying "check first seek-write"
	In write, if the flag is set, clear it and check
	if the write is to the end of the file. If so, use
	statvfs (on Solaris, in this case) to see if the
	size will exceed the non-root space left on the disk.

	Needless to say, I'd prefer not to do that... it's
	a lot of server-side monkey-motion to provide what 
	**should** be a nicety!

David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | //
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at

More information about the samba-technical mailing list