vol: add comment nt_unlink cannot with fopen handles

On Windows, files opened via the CRT fopen or open
POSIX compatibility functions cannot be marked for delete
on close.  Add a comment until such time as the use of
fopen and open on Windows can be replaced.

Change-Id: I9cec46bef332c981b2f64ba85e310783e3c71bc9
Reviewed-on: http://gerrit.openafs.org/3707
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
This commit is contained in:
Jeffrey Altman 2011-01-20 02:06:12 -05:00 committed by Derrick Brashear
parent 55ca096adb
commit eb6f3a89a3

View File

@ -858,6 +858,12 @@ SalvageFileSys1(struct DiskPartition64 *partP, VolumeId singleVolumeNumber)
* semantics of unlink. In most places in the salvager, we really do
* mean to unlink the file at that point. Those places have been
* modified to actually do that so that the NT crt can be used there.
*
* jaltman - On NT delete on close cannot be applied to a file while the
* process has an open file handle that does not have DELETE file
* access and FILE_SHARE_DELETE. fopen() calls CreateFile() without
* delete privileges. As a result the nt_unlink() call will always
* fail.
*/
code = nt_unlink(inodeListPath);
#else
@ -1181,6 +1187,9 @@ GetInodeSummary(struct SalvInfo *salvinfo, FILE *inodeFile, VolumeId singleVolum
* semantics of unlink. In most places in the salvager, we really do
* mean to unlink the file at that point. Those places have been
* modified to actually do that so that the NT crt can be used there.
*
* jaltman - As commented elsewhere, this cannot work because fopen()
* does not open files with DELETE and FILE_SHARE_DELETE.
*/
code = nt_unlink(summaryFileName);
#else