Empty file after STATUS_DISK_FULL from CREATE

Christof Schmitt cs at samba.org
Thu Aug 29 19:50:43 UTC 2019


Hi,

i am looking at a problem where creating a file also requested space
allocation, that failed due to insufficient quota space, the request
returned STATUS_DISK_FULL and an empty file was left behind. From
looking at the code the steps are clear: First the file is created, and
then the call to vfs_allocate_file_space() fails which  leads to
STATUS_DISK_FULL. The created file cannnot be deleted, as this would
create a race condition as it cannot be guaranteed that the same file is
deleted.

Linux provides the O_TMPFILE flag for the open() call to first create a
file without name. Then all checks could be done, including space
allocation, and only if everything succeeds the file will be linked into
a directory.  Has anybody looked whether using O_TMPFILE in Samba would
be feasible at all?

Christof



More information about the samba-technical mailing list