Author: tfaber
Date: Sat Mar 28 16:58:53 2015
New Revision: 66931
URL:
http://svn.reactos.org/svn/reactos?rev=66931&view=rev
Log:
[FASTFAT]
- Do not delete files that have open handles
- Delete on cleanup instead of close, and do not depend on FileObject->DeletePending
(since the last file object is not necessarily the one that caused the delete)
CORE-9433
Modified:
trunk/reactos/drivers/filesystems/fastfat/cleanup.c
trunk/reactos/drivers/filesystems/fastfat/close.c
Modified: trunk/reactos/drivers/filesystems/fastfat/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] Sat Mar 28 16:58:53
2015
@@ -93,11 +93,30 @@
ObDereferenceObject(tmpFileObject);
}
- CcPurgeCacheSection(FileObject->SectionObjectPointer, NULL, 0, FALSE);
+ pFcb->RFCB.ValidDataLength.QuadPart = 0;
+ pFcb->RFCB.FileSize.QuadPart = 0;
+ pFcb->RFCB.AllocationSize.QuadPart = 0;
}
/* Uninitialize the cache (should be done even if caching was never initialized)
*/
CcUninitializeCacheMap(FileObject, &pFcb->RFCB.FileSize, NULL);
+
+ if (pFcb->Flags & FCB_DELETE_PENDING &&
+ pFcb->OpenHandleCount == 0)
+ {
+ VfatDelEntry(DeviceExt, pFcb, NULL);
+
+ FsRtlNotifyFullReportChange(DeviceExt->NotifySync,
+ &(DeviceExt->NotifyList),
+ (PSTRING)&pFcb->PathNameU,
+ pFcb->PathNameU.Length -
pFcb->LongNameU.Length,
+ NULL,
+ NULL,
+ ((*pFcb->Attributes &
FILE_ATTRIBUTE_DIRECTORY) ?
+ FILE_NOTIFY_CHANGE_DIR_NAME :
FILE_NOTIFY_CHANGE_FILE_NAME),
+ FILE_ACTION_REMOVED,
+ NULL);
+ }
if (pFcb->OpenHandleCount != 0)
{
Modified: trunk/reactos/drivers/filesystems/fastfat/close.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/close.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/close.c [iso-8859-1] Sat Mar 28 16:58:53
2015
@@ -46,29 +46,6 @@
}
else
{
- if (FileObject->DeletePending)
- {
- if (pFcb->Flags & FCB_DELETE_PENDING)
- {
- VfatDelEntry(DeviceExt, pFcb, NULL);
-
- FsRtlNotifyFullReportChange(DeviceExt->NotifySync,
- &(DeviceExt->NotifyList),
- (PSTRING)&pFcb->PathNameU,
- pFcb->PathNameU.Length -
pFcb->LongNameU.Length,
- NULL,
- NULL,
- ((*pFcb->Attributes &
FILE_ATTRIBUTE_DIRECTORY) ?
- FILE_NOTIFY_CHANGE_DIR_NAME :
FILE_NOTIFY_CHANGE_FILE_NAME),
- FILE_ACTION_REMOVED,
- NULL);
- }
- else
- {
- Status = STATUS_DELETE_PENDING;
- }
- }
-
vfatReleaseFCB(DeviceExt, pFcb);
}