FltRollbackEnlistment cannot be called from TransactionNotificationCallback

Hi all,

This a question for Microsoft folks. Can a minifilter rollback a transaction calling FltRollbackEnlistment after the pre-prepare/prepare/commit sequence has been initiated?.

Calling FltRollbackEnlistment from the TransactionNotificationCallback, at least during the pre-prepare and prepare phases causes a bugcheck due to access violation. This is reasonable as the transacion is rolled back in the pre-prepare phase and there was no way to tell the TxF to fail the pre-prepare.

In order to rollback a transaction when it is in the pre-prepare phase, should the minifilter create its own volatile resource manager and enlist in the transction using it?.

Thanks,
Ramon

Really silly question, but do you really only want “Microsoft folk” to
answer? This list is cohabited by folk that, in some instances, may know
more about answering your question than the “Microsoft folk”. Since they are
not “blessed by Microsoft” should they simply sit there and twiddle their
thumbs, struggling mightily to resist the urge to take keyboard in hand and
answer your question, simply because they are not “Microsoft folk”, and who
are known to be able to write a Fibonacci sequence?

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@edermind.com
Sent: Friday, August 27, 2010 11:17 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] FltRollbackEnlistment cannot be called from
TransactionNotificationCallback

Hi all,

This a question for Microsoft folks. Can a minifilter rollback a transaction
calling FltRollbackEnlistment after the pre-prepare/prepare/commit sequence
has been initiated?.

Calling FltRollbackEnlistment from the TransactionNotificationCallback, at
least during the pre-prepare and prepare phases causes a bugcheck due to
access violation. This is reasonable as the transacion is rolled back in the
pre-prepare phase and there was no way to tell the TxF to fail the
pre-prepare.

In order to rollback a transaction when it is in the pre-prepare phase,
should the minifilter create its own volatile resource manager and enlist in
the transction using it?.

Thanks,
Ramon


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars (including our new fs
mini-filter seminar) 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

On 8/27/2010 10:17 AM, xxxxx@edermind.com wrote:

Hi all,

This a question for Microsoft folks. Can a minifilter rollback a transaction calling FltRollbackEnlistment after the pre-prepare/prepare/commit sequence has been initiated?.

Calling FltRollbackEnlistment from the TransactionNotificationCallback, at least during the pre-prepare and prepare phases causes a bugcheck due to access violation. This is reasonable as the transacion is rolled back in the pre-prepare phase and there was no way to tell the TxF to fail the pre-prepare.

In order to rollback a transaction when it is in the pre-prepare phase, should the minifilter create its own volatile resource manager and enlist in the transction using it?.

Aside from Gary’s comments, since this is from a non-Microsoft-y …

The only successful approach I have implemented is where I create an RM
and control actions from that perspective. Outside of this realm,
processing requests in any other manner than inspection has resulted in
varying degrees of success.

Pete

Thanks,
Ramon


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) 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


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

> This a question for Microsoft folks. Can a minifilter rollback a transaction calling

FltRollbackEnlistment after the pre-prepare/prepare/commit sequence has been initiated?.

Rollback after commit? how is this possible?


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

Thanks all. I think I will implement your approach Pete.

but do you really only want “Microsoft folk” to answer?

Gary, I appreciate very much answers from any folk. My reference to
Microsoft folks was only a hint as I think they can answer easily about
something that they own and which seems poorly documented.

Rollback after commit? how is this possible?

Maxim, I understand the pre-prepare for a transaction can be initiated
at any time. So I wonder if even from the context of a transacted
operation the following race condition may cause a bugcheck:

if (TmIsTransactionActive( FltObjects->Transaction )) {
//
// Rolls back a transaction on behalf of the
// minifilter.
//

/*At this moment anyone else can initiate the pre-prepare phase*/

FltRollbackEnlistment( FltObjects->Instance,
FltObjects->Transaction,
TransactionContext );
}

I will test this scenario. But if someone else may shed some light about
the correct way to use FltRollBackEnlistment routine I’d very much
appreciate it :). Maybe transactions were discussed in the latest IFS
plugfest?.

Thanks,
Ramon

On 08/28/2010 2:37, Peter Scott wrote:

On 8/27/2010 10:17 AM, xxxxx@edermind.com wrote:
> Hi all,
>
> This a question for Microsoft folks. Can a minifilter rollback a
> transaction calling FltRollbackEnlistment after the
> pre-prepare/prepare/commit sequence has been initiated?.
>
> Calling FltRollbackEnlistment from the
> TransactionNotificationCallback, at least during the pre-prepare and
> prepare phases causes a bugcheck due to access violation. This is
> reasonable as the transacion is rolled back in the pre-prepare phase
> and there was no way to tell the TxF to fail the pre-prepare.
>
> In order to rollback a transaction when it is in the pre-prepare
> phase, should the minifilter create its own volatile resource manager
> and enlist in the transction using it?.
>

Aside from Gary’s comments, since this is from a non-Microsoft-y …

The only successful approach I have implemented is where I create an RM
and control actions from that perspective. Outside of this realm,
processing requests in any other manner than inspection has resulted in
varying degrees of success.

Pete

> Thanks,
> Ramon
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) 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