IRP_MJ_WRITE IRP_MN_COMPLETE_MDL IrpSp->Parameters.Write.Length FastIoMdlWriteComplete

Gentlefolk

I wonder if anyone can say for sure whether in case of IRP_MJ_WRITE
IRP_MN_COMPLETE_MDL is IrpSp->Parameters.Write.Length field is ‘correct’ as
in it matches the value from the IRP_MJ_WRITE IRP_MN_MDL? I notice that in
the FastIo MdlWrite path there is no length parameter in
FastIoMdlWriteComplete.

Thanks
Lyndon

The rule for the MDL write routine is that the caller has to write the
entire region they’ve specified. Since we know (a priori) they are a
kernel level caller, we also know that they don’t want to expose
information. Thus, neither Cc nor Fsd will scrub that memory region.
The MDL then encodes a description of the entire region (offset into
first page, length of data region spanning all pages through the last
page).

Hence, in the completion path, we generally don’t need to know what the
length was (and if we really need it, the MDL encodes that information).

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

Looking forward to seeing you at the next OSR File Systems class in Los
Angeles, CA October 24-27, 2005.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lyndon J Clarke
Sent: Tuesday, September 13, 2005 4:22 AM
To: ntfsd redirect
Subject: [ntfsd] IRP_MJ_WRITE IRP_MN_COMPLETE_MDL
IrpSp->Parameters.Write.Length FastIoMdlWriteComplete

Gentlefolk

I wonder if anyone can say for sure whether in case of IRP_MJ_WRITE
IRP_MN_COMPLETE_MDL is IrpSp->Parameters.Write.Length field is ‘correct’
as
in it matches the value from the IRP_MJ_WRITE IRP_MN_MDL? I notice that
in
the FastIo MdlWrite path there is no length parameter in
FastIoMdlWriteComplete.

Thanks
Lyndon


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Tony

Thanks this is all clear. I assume you mean the MdlByteCount? What about the
case where the Mdl is a chain, ie Mdl->Next is not NULL.

Cheers
Lyndon

“Tony Mason” wrote in message news:xxxxx@ntfsd…
The rule for the MDL write routine is that the caller has to write the
entire region they’ve specified. Since we know (a priori) they are a
kernel level caller, we also know that they don’t want to expose
information. Thus, neither Cc nor Fsd will scrub that memory region.
The MDL then encodes a description of the entire region (offset into
first page, length of data region spanning all pages through the last
page).

Hence, in the completion path, we generally don’t need to know what the
length was (and if we really need it, the MDL encodes that information).

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

Looking forward to seeing you at the next OSR File Systems class in Los
Angeles, CA October 24-27, 2005.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lyndon J Clarke
Sent: Tuesday, September 13, 2005 4:22 AM
To: ntfsd redirect
Subject: [ntfsd] IRP_MJ_WRITE IRP_MN_COMPLETE_MDL
IrpSp->Parameters.Write.Length FastIoMdlWriteComplete

Gentlefolk

I wonder if anyone can say for sure whether in case of IRP_MJ_WRITE
IRP_MN_COMPLETE_MDL is IrpSp->Parameters.Write.Length field is ‘correct’
as
in it matches the value from the IRP_MJ_WRITE IRP_MN_MDL? I notice that
in
the FastIo MdlWrite path there is no length parameter in
FastIoMdlWriteComplete.

Thanks
Lyndon


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Lyndon,

Yes, good point that you have to look at the chain (I forget that
because chaining of MDLs isn’t currently done in the file systems space,
although it does happen in the network space.)

Thus, the entire length would be the sum of the sizes of each MDL. By
“offset” I meant the value returned from MmGetMdlByteOffset and by
“length” I meant the value returned from MmGetMdlByteCount. Of course,
as corrected, I mean the SUM of the values of MmGetMdlByteCount for each
MDL in the chain.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

Looking forward to seeing you at the next OSR File Systems class in Los
Angeles, CA October 24-27, 2005.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lyndon J Clarke
Sent: Tuesday, September 13, 2005 7:11 AM
To: ntfsd redirect
Subject: Re:[ntfsd] IRP_MJ_WRITE IRP_MN_COMPLETE_MDL
IrpSp->Parameters.Write.Length FastIoMdlWriteComplete

Tony

Thanks this is all clear. I assume you mean the MdlByteCount? What about
the
case where the Mdl is a chain, ie Mdl->Next is not NULL.

Cheers
Lyndon

“Tony Mason” wrote in message news:xxxxx@ntfsd…
The rule for the MDL write routine is that the caller has to write the
entire region they’ve specified. Since we know (a priori) they are a
kernel level caller, we also know that they don’t want to expose
information. Thus, neither Cc nor Fsd will scrub that memory region.
The MDL then encodes a description of the entire region (offset into
first page, length of data region spanning all pages through the last
page).

Hence, in the completion path, we generally don’t need to know what the
length was (and if we really need it, the MDL encodes that information).

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

Looking forward to seeing you at the next OSR File Systems class in Los
Angeles, CA October 24-27, 2005.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lyndon J Clarke
Sent: Tuesday, September 13, 2005 4:22 AM
To: ntfsd redirect
Subject: [ntfsd] IRP_MJ_WRITE IRP_MN_COMPLETE_MDL
IrpSp->Parameters.Write.Length FastIoMdlWriteComplete

Gentlefolk

I wonder if anyone can say for sure whether in case of IRP_MJ_WRITE
IRP_MN_COMPLETE_MDL is IrpSp->Parameters.Write.Length field is ‘correct’
as
in it matches the value from the IRP_MJ_WRITE IRP_MN_MDL? I notice that
in
the FastIo MdlWrite path there is no length parameter in
FastIoMdlWriteComplete.

Thanks
Lyndon


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com