]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: add comment nt_unlink cannot with fopen handles
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 20 Jan 2011 07:06:12 +0000 (02:06 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 8 Feb 2011 00:52:05 +0000 (16:52 -0800)
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.

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>
(cherry picked from commit eb6f3a89a3f4da6d3de2d4ae34743014e4eb0fb2)

Change-Id: I6d66617b53f46e832d72ac8ed9a41730fafca521
Reviewed-on: http://gerrit.openafs.org/3854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/vol-salvage.c

index d19b39af652d1d4c5aeb5bda8d08baa9716992b9..656ec52b65f56f1c5e461efb2da084fbec82ddfb 100644 (file)
@@ -840,6 +840,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
@@ -1162,6 +1168,9 @@ GetInodeSummary(FILE *inodeFile, 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 - As commented elsewhere, this cannot work because fopen()
+     * does not open files with DELETE and FILE_SHARE_DELETE.
      */
     code = nt_unlink(summaryFileName);
 #else