Author: pschweitzer
Date: Tue Feb 23 22:19:38 2016
New Revision: 70779
URL:
http://svn.reactos.org/svn/reactos?rev=70779&view=rev
Log:
[NTFS]
Even more locking
Modified:
trunk/reactos/drivers/filesystems/ntfs/dirctl.c
trunk/reactos/drivers/filesystems/ntfs/volinfo.c
Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Tue Feb 23 22:19:38 2016
@@ -305,6 +305,12 @@
return STATUS_NOT_IMPLEMENTED;
}
+ if (!ExAcquireResourceSharedLite(&Fcb->MainResource,
+ BooleanFlagOn(IrpContext->Flags,
IRPCONTEXT_CANWAIT)))
+ {
+ return STATUS_PENDING;
+ }
+
if (SearchPattern != NULL)
{
if (!Ccb->DirectorySearchPattern)
@@ -316,6 +322,7 @@
ExAllocatePoolWithTag(NonPagedPool, Pattern.MaximumLength, TAG_NTFS);
if (!Ccb->DirectorySearchPattern)
{
+ ExReleaseResourceLite(&Fcb->MainResource);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -329,6 +336,7 @@
Ccb->DirectorySearchPattern = ExAllocatePoolWithTag(NonPagedPool, 2 *
sizeof(WCHAR), TAG_NTFS);
if (!Ccb->DirectorySearchPattern)
{
+ ExReleaseResourceLite(&Fcb->MainResource);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -461,6 +469,8 @@
Buffer0->NextEntryOffset = 0;
}
+ ExReleaseResourceLite(&Fcb->MainResource);
+
if (FileIndex > 0)
{
Status = STATUS_SUCCESS;
Modified: trunk/reactos/drivers/filesystems/ntfs/volinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/v…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] Tue Feb 23 22:19:38
2016
@@ -246,6 +246,7 @@
NTSTATUS Status = STATUS_SUCCESS;
PVOID SystemBuffer;
ULONG BufferLength;
+ PDEVICE_EXTENSION DeviceExt;
DPRINT("NtfsQueryVolumeInformation() called\n");
@@ -253,7 +254,15 @@
Irp = IrpContext->Irp;
DeviceObject = IrpContext->DeviceObject;
+ DeviceExt = DeviceObject->DeviceExtension;
Stack = IrpContext->Stack;
+
+ if (!ExAcquireResourceSharedLite(&DeviceExt->DirResource,
+ BooleanFlagOn(IrpContext->Flags,
IRPCONTEXT_CANWAIT)))
+ {
+ return NtfsMarkIrpContextForQueue(IrpContext);
+ }
+
FsInformationClass = Stack->Parameters.QueryVolume.FsInformationClass;
BufferLength = Stack->Parameters.QueryVolume.Length;
SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
@@ -292,6 +301,8 @@
Status = STATUS_NOT_SUPPORTED;
}
+ ExReleaseResourceLite(&DeviceExt->DirResource);
+
if (NT_SUCCESS(Status))
Irp->IoStatus.Information =
Stack->Parameters.QueryVolume.Length - BufferLength;