Author: pschweitzer
Date: Sun Nov 2 23:11:22 2014
New Revision: 65205
URL: http://svn.reactos.org/svn/reactos?rev=65205&view=rev
Log:
[DISK]
Add a hack to forcibly set sector size in case of weird input. This is noisy on purpose.
Also, be more informative in case of read rejection. Are we reading beyond partition or do we have invalid sector size?
With the hack, the invalid sector size should disappear.
This is to help debugging the recent errors with the removal of IopParseDevice() hack
Modified:
trunk/reactos/drivers/storage/class/disk/disk.c
Modified: trunk/reactos/drivers/storage/class/disk/disk.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/disk…
==============================================================================
--- trunk/reactos/drivers/storage/class/disk/disk.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/disk/disk.c [iso-8859-1] Sun Nov 2 23:11:22 2014
@@ -1515,6 +1515,15 @@
LARGE_INTEGER startingOffset;
//
+ // HACK: How can we end here with null sector size?!
+ //
+
+ if (deviceExtension->DiskGeometry->Geometry.BytesPerSector == 0) {
+ DPRINT1("Hack! Received invalid sector size\n");
+ deviceExtension->DiskGeometry->Geometry.BytesPerSector = 512;
+ }
+
+ //
// Verify parameters of this request.
// Check that ending sector is within partition and
// that number of bytes to transfer is a multiple of
@@ -1550,7 +1559,18 @@
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
}
- DPRINT1("STATUS_INVALID_PARAMETER\n");
+ if (startingOffset.QuadPart > deviceExtension->PartitionLength.QuadPart) {
+ DPRINT1("Reading beyond partition end! startingOffset: %I64d, PartitionLength: %I64d\n", startingOffset.QuadPart, deviceExtension->PartitionLength.QuadPart);
+ }
+
+ if (transferByteCount & (deviceExtension->DiskGeometry->Geometry.BytesPerSector - 1)) {
+ DPRINT1("Not reading sectors! TransferByteCount: %lu, BytesPerSector: %lu\n", transferByteCount, deviceExtension->DiskGeometry->Geometry.BytesPerSector);
+ }
+
+ if (Irp->IoStatus.Status == STATUS_DEVICE_NOT_READY) {
+ DPRINT1("Failing due to device not ready!\n");
+ }
+
return STATUS_INVALID_PARAMETER;
}
Author: pschweitzer
Date: Sun Nov 2 21:50:40 2014
New Revision: 65198
URL: http://svn.reactos.org/svn/reactos?rev=65198&view=rev
Log:
[NTFS]
Update headers.
Hervé, feel free to copy :-P
Modified:
trunk/reactos/drivers/filesystems/ntfs/create.c
trunk/reactos/drivers/filesystems/ntfs/dirctl.c
trunk/reactos/drivers/filesystems/ntfs/fcb.c
trunk/reactos/drivers/filesystems/ntfs/mft.c
trunk/reactos/drivers/filesystems/ntfs/misc.c
trunk/reactos/drivers/filesystems/ntfs/rw.c
trunk/reactos/drivers/filesystems/ntfs/volinfo.c
Modified: trunk/reactos/drivers/filesystems/ntfs/create.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/create.c [iso-8859-1] Sun Nov 2 21:50:40 2014
@@ -1,6 +1,6 @@
/*
* ReactOS kernel
- * Copyright (C) 2002 ReactOS Team
+ * Copyright (C) 2002, 2014 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,8 @@
* PROJECT: ReactOS kernel
* FILE: drivers/filesystem/ntfs/create.c
* PURPOSE: NTFS filesystem driver
- * PROGRAMMER: Eric Kohl
+ * PROGRAMMERS: Eric Kohl
+ * Pierre Schweitzer (pierre(a)reactos.org)
*/
/* INCLUDES *****************************************************************/
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] Sun Nov 2 21:50:40 2014
@@ -1,6 +1,6 @@
/*
* ReactOS kernel
- * Copyright (C) 2002,2003 ReactOS Team
+ * Copyright (C) 2002, 2003, 2014 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,8 @@
* PROJECT: ReactOS kernel
* FILE: drivers/filesystem/ntfs/dirctl.c
* PURPOSE: NTFS filesystem driver
- * PROGRAMMER: Eric Kohl
+ * PROGRAMMERS: Eric Kohl
+ * Pierre Schweitzer (pierre(a)reactos.org)
*/
/* INCLUDES *****************************************************************/
Modified: trunk/reactos/drivers/filesystems/ntfs/fcb.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Sun Nov 2 21:50:40 2014
@@ -1,6 +1,6 @@
/*
* ReactOS kernel
- * Copyright (C) 2002 ReactOS Team
+ * Copyright (C) 2002, 2014 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,8 @@
* PROJECT: ReactOS kernel
* FILE: drivers/filesystem/ntfs/fcb.c
* PURPOSE: NTFS filesystem driver
- * PROGRAMMER: Eric Kohl
+ * PROGRAMMERS: Eric Kohl
+ * Pierre Schweitzer (pierre(a)reactos.org)
*/
/* INCLUDES *****************************************************************/
Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] Sun Nov 2 21:50:40 2014
@@ -1,6 +1,6 @@
/*
* ReactOS kernel
- * Copyright (C) 2002 ReactOS Team
+ * Copyright (C) 2002, 2014 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,8 +20,9 @@
* PROJECT: ReactOS kernel
* FILE: drivers/filesystem/ntfs/mft.c
* PURPOSE: NTFS filesystem driver
- * PROGRAMMER: Eric Kohl
- * Updated by Valentin Verkhovsky 2003/09/12
+ * PROGRAMMERS: Eric Kohl
+ * Valentin Verkhovsky
+ * Pierre Schweitzer (pierre(a)reactos.org)
*/
/* INCLUDES *****************************************************************/
Modified: trunk/reactos/drivers/filesystems/ntfs/misc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/misc.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/misc.c [iso-8859-1] Sun Nov 2 21:50:40 2014
@@ -1,6 +1,6 @@
/*
* ReactOS kernel
- * Copyright (C) 2008 ReactOS Team
+ * Copyright (C) 2008, 2014 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Modified: trunk/reactos/drivers/filesystems/ntfs/rw.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] Sun Nov 2 21:50:40 2014
@@ -1,6 +1,6 @@
/*
* ReactOS kernel
- * Copyright (C) 2002 ReactOS Team
+ * Copyright (C) 2002, 2014 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,8 +20,8 @@
* PROJECT: ReactOS kernel
* FILE: drivers/filesystem/ntfs/rw.c
* PURPOSE: NTFS filesystem driver
- * PROGRAMMER: Art Yerkes
- * UPDATE HISTORY:
+ * PROGRAMMERS: Art Yerkes
+ * Pierre Schweitzer (pierre(a)reactos.org)
*/
/* INCLUDES *****************************************************************/
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] Sun Nov 2 21:50:40 2014
@@ -1,6 +1,6 @@
/*
* ReactOS kernel
- * Copyright (C) 2002 ReactOS Team
+ * Copyright (C) 2002, 2014 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,8 @@
* PROJECT: ReactOS kernel
* FILE: drivers/filesystem/ntfs/volume.c
* PURPOSE: NTFS filesystem driver
- * PROGRAMMER: Eric Kohl
+ * PROGRAMMERS: Eric Kohl
+ * Pierre Schweitzer (pierre(a)reactos.org)
*/
/* INCLUDES *****************************************************************/
Author: hpoussin
Date: Sun Nov 2 20:18:34 2014
New Revision: 65196
URL: http://svn.reactos.org/svn/reactos?rev=65196&view=rev
Log:
[NTFS] Hack fix duplicate directory entries for files having a short name and a long name
Modified:
trunk/reactos/drivers/filesystems/ntfs/dirctl.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] Sun Nov 2 20:18:34 2014
@@ -310,7 +310,7 @@
NTSTATUS Status = STATUS_SUCCESS;
PFILE_RECORD_HEADER FileRecord;
PNTFS_ATTR_CONTEXT DataContext;
- ULONGLONG MFTRecord;
+ ULONGLONG MFTRecord, OldMFTRecord = 0;
UNICODE_STRING Pattern;
DPRINT1("NtfsQueryDirectory() called\n");
@@ -405,10 +405,21 @@
&DataContext,
&MFTRecord,
Fcb->MFTIndex);
- //DPRINT("Found %S, Status=%x, entry %x\n", TempFcb.ObjectName, Status, Ccb->Entry);
if (NT_SUCCESS(Status))
{
+ /* HACK: files with both a short name and a long name are present twice in the index.
+ * Ignore the second entry, if it is immediately following the first one.
+ */
+ if (MFTRecord == OldMFTRecord)
+ {
+ DPRINT("Ignoring duplicate MFT entry 0x%x\n", MFTRecord);
+ Ccb->Entry++;
+ ExFreePoolWithTag(FileRecord, TAG_NTFS);
+ continue;
+ }
+ OldMFTRecord = MFTRecord;
+
switch (FileInformationClass)
{
case FileNameInformation: