Re[2]: Re[2]: Re[2]: Re[2]: Re[2]: Re[2]: How do i redirect writes and create a mapping table of log

More likely you are not correctly processing a READ request, note it is
an IN_PAGE error. I would first start with the obvious, that a failure
is occurring on a read request. You can capture this by either adding
trace or using IrpTracker from OSROnline. If there is no explicit
failure then you’ll need to validate that each block being written is
retrieved at the time of read correctly.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com http:</http:>
866.263.9295

------ Original Message ------
From: xxxxx@yahoo.fr
To: “Windows File Systems Devs Interest List”
Sent: 10/12/2015 7:28:36 PM
Subject: RE:[ntfsd] Re[2]: Re[2]: Re[2]: Re[2]: Re[2]: How do i redirect
writes and create a mapping table of logical blocks to offsets

>Thank you Peter, I’ve come to make some progress.
>My filter driver is in fact able to restore to some baseline after we
>reboot, but then I get the following error (KERNEL DATA IN PAGE ERROR)
>especially when I perform some operation that produce a lot of writes
>on the disk). I googled it and it came that this error can be fix by a
>disk check (CHKDSK /f /r) or a memory check, otherwise I have a
>deficient hardware. But the thing is my hardware is correct. Could it
>be that I am not properly writing raw data on the disk during the
>redirection process?
>Have any of you faced that before?
>
>Thank you
>
>—
>NTFSD is sponsored by OSR
>
>OSR is hiring!! Info at http://www.osr.com/careers
>
>For our schedule of debugging and file system seminars visit:
>http://www.osr.com/seminars
>
>To unsubscribe, visit the List Server section of OSR Online at
>http://www.osronline.com/page.cfm?name=ListServer

Thank you Peter, I finally got it fixed. Looks like i was messing up with some Irp from pagefile.sys.
One of the last things that bothers me is this:
I need to allow only certain process to perform flushes on disk (Windows update in occurence). In a previous question, I learned that I can’t just rely on PsGetCurrentProcessId since at the volume level, what i am getting would be some system threads performing flushes on diskthus obtaining the System PID in place of the PID of the process that actually initiated the IRP. So I used a control device object that sits on the top of my filter and i used it to retrieve information not allowed to get at the disk level (like the bitmap or other information that i would only get at the file system level).

I know that the IoManager gives us the IRPs in the process context that made the request. Thus using my control device object that sits on the top of the disk filter, can i now rely on the API PsGetCurrentProcessId to get the process that launched the IRP, if no device is attached to mine first?
Or what about first getting the thread that created the IRP using pIrp->Tail.Overlay.Thread. to get a pointer to the ETHREAD structure, then get the process that ows it with IoThreadToProcess API and finally make something usable with ZwQueryInformationProcess?

Any hint will be much appreciated.
Thank you

Sorry I pressed too fast on the button.
My question is
I know that the IoManager gives us the IRPs in the process context that made the
request. Wwhen getting the IRp in the disk filter driver can i rely on the API PsGetCurrentProcessId to get the process that launched the IRP, if no device is attached to mine first?
Or what about first getting the thread that created the IRP using
pIrp->Tail.Overlay.Thread. to get a pointer to the ETHREAD structure, then get
the process that ows it with IoThreadToProcess API and finally make something
usable with ZwQueryInformationProcess?

Any hint will be much appreciated.
Thank you

> request. Wwhen getting the IRp in the disk filter driver can i rely on the API PsGetCurrentProcessId

to get the process that launched the IRP, if no device is attached to mine first?

No you can’t. Cache flushes/lazy writes by Cc worker threads will have System there.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Any idea on how i could achieve that?

Thanks

Look at http://www.wd-3.com/archive/luserland.htm

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.fr
Sent: Saturday, October 17, 2015 6:46 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Re[2]: Re[2]: Re[2]: Re[2]: Re[2]: Re[2]: How do i
redirect writes and create a mapping table of logical blocks to offsets

Any idea on how i could achieve that?

Thanks


NTFSD is sponsored by OSR

OSR is hiring!! Info at http://www.osr.com/careers

For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer