deleted files are coming back from the dead.

Joey Collins joeycollins at
Tue Oct 26 03:42:35 GMT 2004

Hi everyone,
I have a problem with deleted files coming back from the dead.

Suppose there are 'many' files on a Windows 2000 server using NTFS
volumes, call them file001 to file999. Suppose my client is issuing a
DELETE FILE smb on each file in order, waiting for the response from the
server before going on to the next file.

Now let the server crash and reboot while that is going on. And for this
exercise, we can assume that the crash happens 'between' DELETE FILE
requests, i.e., there is no outstanding request at the server. Suppose
we have just finished deleting file500 when the server crashed.

The client recovers the connection, so it just carries on deleting from

What I see when I look at the server a little later is that (say)
file450 to file500 have not in fact been deleted. Files file001 to
file449 were truly deleted, and file501 to file999 were truly deleted.
The last bunch of deletes from just before the crash have not happened.

What is apparently happening is that when the Windows server recovered,
it 'undid' the last several file deletions. Presumably this is an effect
of NTFS log recovery: the file system elected to undo the in-flight
changes rather than to redo them.

This turns out to be extremely inconvenient for my application. When it
gets the successful response to the DELETE FILE smb, it expects that the
file really has been deleted and is not coming back.

I can see no way that the client can be modified to ensure that the
delete has really happened. There is nothing like a 'write through'
option on the delete smb, nothing like a 'sync metadata' smb that it can
issue to the filer to ensure metadata changes have been persisted.

Is there anything I can do about this either at the CIFS level or (less
desirable) with configuration on the Windows server?

The only way out of this would seem to be to maintain a client-side log
which I would replay if the connection to the server died. But that has
its own problems, such as knowing when to age entries out of the log: I
have no way of knowing when the delete has become permanent.

Thanks a bunch all.


More information about the samba-technical mailing list