Problems with Samba 2.2.0 on Solaris 8 with quotas
davecb at canada.sun.com
Thu Jun 14 14:21:47 GMT 2001
Shirish Kalele wrote:
> This might not be related to Toni's problem, but I also found some
> redirectors that did this in such a scenario (nearing quota limits or disk
> space limits):
> 1. First they try doing a zero-byte write to an offset equaling the size of
> the file being written (copied).
> 2. NTFS seems to allocate space at this point itself, so NT servers return
> an NT_STATUS_DISK_FULL error here.
Yes, that's explicitly what we saw happening
the first time I got involved with this.
Jeremy and the team doped out the rest...
> 3. The client then sets the delete-on-close flag on the file.
> 4. Some RDRs then close the file. Others seem to try to open the file again
> and expect to see an NT_STATUS_DELETE_PENDING error denied them the open.
> This convinces them that the flag has been set and they then close the file.
> Samba 2.2.0 currently returns a disk-full error when the actual data is
> being written to the file and when this write fails with a quota-exceeded or
> no-space error from the OS.
> However, some redirectors that do the above seem to depend only on the
> zero-byte write to decide if there is enough space or not. They don't handle
> failures at a later point (when the actual data writes occur). This leaves
> sparse files on the server.
This is a lot better than the problem looked the
first time we saw it: we suspected we'd have to
either expand every file when asked, keep around
a "free space left" datum from statvfs or fail.
The description above would allow us to do one
check (fstafvfs, for example) if and only if there
was a zero-byte write at the end of the file,
not have to keep any information, and just return
a NO_SPACE failure...
... a quick test with gethrtime on Solaris showed that
the overhead of fstatvfs is extremely low, as the superblock
is in memory . It's smaller that my timer's resolution!
> I know Jeremy thinks doing space checking on zero-byte writes would slow
> things down. But how frequent are these zero-byte writes?
I don't know that, nor do I know the speed of the
SGI/AIX/HPUX/whatever equivalents of fstatvfs. I
suspect they're pretty blinding, but I don't know that.
David Collier-Brown, | Always do right. This will gratify
Performance & Engineering Team | some people and astonish the rest.
Americas Customer Engineering | -- Mark Twain
(905) 415-2849 | davecb at canada.sun.com
More information about the samba-technical