Existing file deleted on disk full (or disk ful) errors

Julie Holloway jhllwy at us.ibm.com
Wed Oct 17 12:16:08 GMT 2001


(Sorry for the poor append previously.  Too much formatting. Here is my
append again, with the original included.  Hopefully, this will make
more sense.)

I too have seen this problem.  Below is a summary of the packet flow
between an NT client and the Samba 2.2.1 server compared with an NT
client with an NT server: (The packet numbers are based on the Network
Monitor traces that I took)

NT client to Samba 2.2.1 case:       NT client to NT server case:
==============================      =============================

pkt 64 -  Tmp file deleted           pkt 221 - Tmp file deleted

pkt 84 - Disk Full error             pkt 237 - Disk Full error

pkt 91 - Open on srvsvc (1)          pkt 242 - Open on srvsvc (1)

pkt 109 - Open on doc1.txt           pkt 256 - Open on doc1.txt

pkt 110-112 - Unlock

pkt 115 - NT IOCTL                   pkt 258 - NT IOCTL

pkt 116 - Fails (unsupported)        pkt 259 - Fails (invalid)

pkt 120 - Open on srvsvc (2)         pkt 266 - Open on srvsvc (2)

pkt 130 - Findfirst on \*            pkt 278 - Findfirst on \*

A bunch of Query path info's

pkt 157 - Open on doc1.txt.txt

pkt 159 - Query file info (0x109)

pkt 160 - fails (Invalid Level)

pkt 168 - Delete of doc1.txt

As you can see, all seems pretty normal in the Samba case until the
FindFirst request. This problem occurs on the current CVS version of
Samba (Linux).

Julie

> Manoj Naik manoj at almaden.ibm.com
> Sun Oct 7 23:11:03 2001
>
> Hi,
>
> I've noticed that applications like Notepad delete an existing file on a
>
> Samba server (as of CVS friday) when a disk full error is returned from
> the filesystem. An NT server, on the other hand, leaves the file intact.
>
> For example, if the filesystem is nearly full (or quotas are about to be
>
> exceeded) and a file is modified and saved (through File->Save
> As->Existing File->Replace) under Notepad, an error is returned ("Disk
> is full" or "Access Denied"). On clicking OK on the error, the file gets
>
> deleted. There is an explicit SMBunlink message coming from the client
> (I haven't figured out why), but this does not happen with NT. "Strict
> Allocate" parameter doesn't affect the behavior. Does anybody have an
> idea what may be happening?
>
> Moreover, there are a couple of places in reply_write and
> reply_write_and_X that return ERRnoaccess when write_file returns 0
> although this may have been due to disk full errors (as indicated by
> errno). I think we should check for EDQUOT and ENOSPC error cases and
> return ERRdiskfull for these.
>
> For example,
>
> diff -u -r1.345 reply.c
> --- reply.c     2 Oct 2001 04:29:46 -0000       1.345
> +++ reply.c     8 Oct 2001 06:03:37 -0000
> @@ -2376,7 +2376,10 @@
>
>    if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0)) {
>      END_PROFILE(SMBwriteX);
> -    return(UNIXERROR(ERRDOS,ERRnoaccess));
> +       if (nwritten == 0 && (errno == ENOSPC || errno == EDQUOT))
> +         return (UNIXERROR(ERRDOS,ERRdiskfull));
> +       else
> +         return(UNIXERROR(ERRDOS,ERRnoaccess));
>    }
>
>    set_message(outbuf,6,0,True);
>
> Manoj.







More information about the samba-technical mailing list