FsRtlLEnterFileSystem

Hi

When should I be using FsRtlEnterFileSystem ? Do I need them around all my
Zw calls ?

TTFN
Paul


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

No.
Around ERESOURCE acquisition only.

Max

----- Original Message -----
From: “Paul Delivett”
To: “File Systems Developers”
Sent: Wednesday, September 19, 2001 1:20 PM
Subject: [ntfsd] FsRtlLEnterFileSystem

> Hi
>
> When should I be using FsRtlEnterFileSystem ? Do I need them around all my
> Zw calls ?
>
> TTFN
> Paul
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

FsRtlEnterFileSystem is really nothing more than a call to
KeEnterCriticalRegion. It blocks the delivery of regular kernel mode APCs,
but allows the delivery of special kernel mode APCs (notably, I/O
completion.)

You should block regular APC delivery for the entire duration of holding an
ERESOURCE - otherwise, you risk arbitrary reentrancy and ultimately deadlock
conditions. Using it AROUND ERESOURCE acquisition is not enough. It must
be held across the entire block of code where the ERESOURCE is held. Thus,
you should do:

FsRtlEnterFileSystem();
ExAcquireResourceSharedLite();
/* lots of protected code */
ExReleaseResourceLite();
FsRtlExitFileSystem();

Regards,

Tony

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

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Wednesday, September 19, 2001 10:02 AM
To: File Systems Developers
Subject: [ntfsd] Re: FsRtlLEnterFileSystem

No.
Around ERESOURCE acquisition only.

Max

----- Original Message -----
From: “Paul Delivett”
To: “File Systems Developers”
Sent: Wednesday, September 19, 2001 1:20 PM
Subject: [ntfsd] FsRtlLEnterFileSystem

> Hi
>
> When should I be using FsRtlEnterFileSystem ? Do I need them around all my
> Zw calls ?
>
> TTFN
> Paul
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> conditions. Using it AROUND ERESOURCE acquisition is not enough. It must

Surely I was meaning exactly this. Around all code path where ERESOURCE is
acquired, not just around ExxxxResourceLite.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi

Thanks for the info. Bang goes my theory then :frowning:

My drive is crashing (on 2000) just after the file
??\C:$Extend$objId:$0:$Index_ALLOCATION has completed its open which is
some 7 hours into testing. Anyone know what this file is ? And if so how can
I make it occur more frequently ?

TTFN
Paul Delivett

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: 19 September 2001 20:27
To: File Systems Developers
Subject: [ntfsd] Re: FsRtlLEnterFileSystem

conditions. Using it AROUND ERESOURCE acquisition is not enough. It must

Surely I was meaning exactly this. Around all code path where ERESOURCE is
acquired, not just around ExxxxResourceLite.

Max


You are currently subscribed to ntfsd as: xxxxx@Carraig.co.uk
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com