Partition Manager and IO path

I have questions regarding partition manager (PartMgr.sys).

  • Does PartMgr is passthrough in read, write or any IO path ?

If not passthrough,

  • Does PartMgr perform any offset translations for an IO ?

If passthrough,

  • Does volume to disk offset translation done at VolMgr layer alone ?

Any help will be highly appreciated.

Yes, it effectively passes through read and write.

Nope.

Yes.

Peter
OSR

> - Does PartMgr is passthrough in read, write or any IO path ?

On pre-Vista, PartMgr only matches the disk partition PDOs to the volume managers.

On Vista+, it is a full PnP bus driver which implements the partition PDOs.

  • Does PartMgr perform any offset translations for an IO ?

Yes on Vista+. IRPs sent to the partition PDOs are translated to become the disk stack IRPs.

On pre-Vista, Disk.sys does the translation.

  • Does volume to disk offset translation done at VolMgr layer alone ?

No. The dumb partition volumes (not software RAIDs) have no translation in VolMgr.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> - Does volume to disk offset translation done at VolMgr layer alone ?

[/quote]

Yes.

Are you really sure? for instance, on pre-Vista, Disk.sys created the PDOs for partitions, and did the offset translations for the IRPs arriving to these PDOs.

In Vista+, the logic is moved to PartMgr.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Sorry, I’m quite sure that’s not correct, as we’ve been spending a lot of time looking at this recently. Basic disks have the translation done from Volume Relative to DISK relative by the Volume Manager. Dynamic partitions are translated by VOLMGRX.

Even in XP, I don’t recall the partition to disk translation being done in disk.sys – In fact, *I* was under the impression that this was moved out of disk.sys when the Volume Manager abstraction was first introduced.

But, I can’t say I remember.

So, yes OP: I was specifically referring to Vista and later, though my memory says that even in the XP timeframe the translation was done before Disk Class… but my memory for details like this is often faulty.

Peter
OSR

OP is right. Disk.sys used to be a bus driver - it created a PDO for each discovered partition. On fixed disks then PartMgr loaded as a bus filter, sucked up the partition objects before they were handed to PNP and gave them over to the volume manager to create volumes. On removable disks PartMgr wouldn’t load and those partitions were usable directly as volumes.

I believe that in Win7 we moved all the partitioning logic out of disk and into partmgr, and got rid of the PDOs for partitions.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Thursday, June 30, 2011 3:38 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Partition Manager and IO path

Sorry, I’m quite sure that’s not correct, as we’ve been spending a lot of time looking at this recently. Basic disks have the translation done from Volume Relative to DISK relative by the Volume Manager. Dynamic partitions are translated by VOLMGRX.

[quote]
on pre-Vista, Disk.sys created the PDOs for partitions, and did the offset translations for the IRPs arriving to these PDOs [/quote]

Even in XP, I don’t recall the partition to disk translation being done in disk.sys – In fact, *I* was under the impression that this was moved out of disk.sys when the Volume Manager abstraction was first introduced.

But, I can’t say I remember.

So, yes OP: I was specifically referring to Vista and later, though my memory says that even in the XP timeframe the translation was done before Disk Class… but my memory for details like this is often faulty.

Peter
OSR


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other 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

Hi Peter… how you been? Long time no see.

Actually, that would be Max, not the OP.

On this, we ALL agree.

Yeah, it was either Vista or Win7. Certainly in Win7, Disk Class no longer creates the PDOs… and rather they’re created by the Partition Manager… which is an upper filter of Disk Class. Which sorta makes better intuitive sense.

The question *I* can’t remember is who does the mapping for basic volumes in Windows XP? I think in XP it was STILL done in the partition manager, wasn’t it? I don’t think it was done in Disk Class since, oh, I want to say Win2K or NT V4…

Peter
OSR

>I believe that in Win7 we moved all the partitioning logic out of disk and into partmgr

In Vista I think, according to WDK 6001.18002 samples.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> The question *I* can’t remember is who does the mapping for basic volumes in Windows XP?

Below is the cite from classpnp!ClassReadWrite function from XP DDK sample.

/*

* Add partition byte offset to make starting byte relative to

* beginning of disk.

*/

currentIrpStack->Parameters.Read.ByteOffset.QuadPart +=

commonExtension->StartingOffset.QuadPart;


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks Maxim and Peter for detailed explanation.

Thanks for taking the time to answer this, Max…

One lingering question, though: That code actually gets invoked in XP, right? I seem to recall that the code for creating the partition PDOs is still in the Win 7 version of Disk Class, it’s just never called.

I’m not saying that’s the case for XP… just asking.

Peter
OSR

>> One lingering question, though: That code actually gets invoked in XP, right?

IIRC I’ve looked at this stuff once in WinDbg around year 2009, and yes, on pre-Vista the PDOs were really belonging to Disk/ClassPnP.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com