What does "Assertion failed: deviceRelations" mean?

I have a file system filter that works fine under NT4.0. When compiled and
running with W2K DDK on a W2K (Checked) system I get

*** Assertion failed: deviceRelations
*** Source File: F:\nt\private\ntos\io\pnpioapi.c, line 8107

Anyone any clues?

It happens when I intercept the call to IRP_MN_MOUNT_VOLUME, and in the
completion routine do a IoCreateDevice() and
IoAttachDeviceToDeviceStack().

This happens for the ntfs filesystem. With Free build, I get the BSOD
complaining abount NTFS not there.

Thanks


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

> It happens when I intercept the call to IRP_MN_MOUNT_VOLUME, and in the

completion routine do a IoCreateDevice() and
IoAttachDeviceToDeviceStack().

Usually, the FS filter pre-creates a device in way down and attaches it to the stack in the completion routine.
If the mount fails (and is fairly often, any Disk Management manipulation will result in the OS trying to enumerate all FSD/volume
combinations, most of them will fail) - then the completion routine does not call IoDeleteDevice nevertheless. It puts the device
object to some list.

I think that this is in order to avoid IoCreate/DeleteDevice in the completion routine.

See SFILTER sample for details.

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

Max,

All clues are useful. However, when trapping the IRP_MN_MOUNT_VOLUME, my
code is

case IRP_MN_MOUNT_VOLUME:
IoCopyCurrentIrpStackLocationNext (Irp);
IoSetCompletionRoutine (Irp, MountFsCompletion, 0, TRUE, FALSE, FALSE);
return (IoCallDriver (Ext->NextDeviceObject, Irp));

which implies to me that MountFsCompletion only gets called on successful
mounts.

If I build the SFILTER driver, and rename the sfilter.sys file to my
driver’s name, system boots fine, so I know that there is something wrong
with my code, not the start-up sequence etc.

I continue to puzzle.

Usually, the FS filter pre-creates a device in way down and attaches it to
the stack in the completion routine.
If the mount fails (and is fairly often, any Disk Management manipulation
will result in the OS trying to enumerate all FSD/volume
combinations, most of them will fail) - then the completion routine does
not call IoDeleteDevice nevertheless. It puts the device
object to some list.

I think that this is in order to avoid IoCreate/DeleteDevice in the
completion routine.

See SFILTER sample for details.

Max


You are currently subscribed to ntfsd as: xxxxx@conclusive.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

No. You can delete in a completion routine, but you can not create.

Why not synchronize the mount call?

Also, the list maintained in SFILTER I stupid. I can not understand why
they use such a list. Fastiodetachdevice will handle filter cleanup and
removal. Just remove it!

There are many other silly things in SFILTER. I recommend reviewing
SFILTER and if there is something that you do not understand, chances
are it is not needed :slight_smile:

Jamey
xxxxx@storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jon Shallow
Sent: Thursday, October 11, 2001 1:45 AM
To: File Systems Developers
Subject: [ntfsd] Re: What does “Assertion failed: deviceRelations” mean?

Max,

All clues are useful. However, when trapping the IRP_MN_MOUNT_VOLUME,
my code is … case IRP_MN_MOUNT_VOLUME:
IoCopyCurrentIrpStackLocationNext (Irp); IoSetCompletionRoutine (Irp,
MountFsCompletion, 0, TRUE, FALSE, FALSE); return (IoCallDriver
(Ext->NextDeviceObject, Irp)); … which implies to me that
MountFsCompletion only gets called on successful mounts.

If I build the SFILTER driver, and rename the sfilter.sys file to my
driver’s name, system boots fine, so I know that there is something
wrong with my code, not the start-up sequence etc.

I continue to puzzle.

Usually, the FS filter pre-creates a device in way down and attaches
it to
the stack in the completion routine.
If the mount fails (and is fairly often, any Disk Management
manipulation
will result in the OS trying to enumerate all FSD/volume
combinations, most of them will fail) - then the completion routine
does
not call IoDeleteDevice nevertheless. It puts the device
object to some list.

I think that this is in order to avoid IoCreate/DeleteDevice in the
completion routine.

See SFILTER sample for details.

Max


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


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

I would thoroughly discourage the below advice of discarding what you
don’t understand.
I think it’s important to understand what’s going on - please read the
comments in the driver carefully
too & if you find something that’s out of place etc., ask a question.

It’s also not safe to call IoDeleteDevice() from your completion
routine. Completion routines can be called at DISPATCH_LEVEL and this
routine is not safe to be called at DISPATCH_LEVEL. Yes
creation/attachment aren’t safe either.

Please look at the latest SFILTER samples in the IFSKit. They do not
maintain any sort of lists & do the right thing with respect to mount,
by synchronizing it in the driver & deleting the device in the dispatch.

Thanks -
Ravi
Microsoft Corp.
-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Thursday, October 11, 2001 1:02 AM
To: File Systems Developers
Subject: [ntfsd] Re: What does “Assertion failed: deviceRelations” mean?

No. You can delete in a completion routine, but you can not create.

Why not synchronize the mount call?

Also, the list maintained in SFILTER I stupid. I can not understand why
they use such a list. Fastiodetachdevice will handle filter cleanup and
removal. Just remove it!

There are many other silly things in SFILTER. I recommend reviewing
SFILTER and if there is something that you do not understand, chances
are it is not needed :slight_smile:

Jamey
xxxxx@storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jon Shallow
Sent: Thursday, October 11, 2001 1:45 AM
To: File Systems Developers
Subject: [ntfsd] Re: What does “Assertion failed: deviceRelations” mean?

Max,

All clues are useful. However, when trapping the IRP_MN_MOUNT_VOLUME,
my code is … case IRP_MN_MOUNT_VOLUME:
IoCopyCurrentIrpStackLocationNext (Irp); IoSetCompletionRoutine (Irp,
MountFsCompletion, 0, TRUE, FALSE, FALSE); return (IoCallDriver
(Ext->NextDeviceObject, Irp)); … which implies to me that
MountFsCompletion only gets called on successful mounts.

If I build the SFILTER driver, and rename the sfilter.sys file to my
driver’s name, system boots fine, so I know that there is something
wrong with my code, not the start-up sequence etc.

I continue to puzzle.

Usually, the FS filter pre-creates a device in way down and attaches
it to
the stack in the completion routine.
If the mount fails (and is fairly often, any Disk Management
manipulation
will result in the OS trying to enumerate all FSD/volume
combinations, most of them will fail) - then the completion routine
does
not call IoDeleteDevice nevertheless. It puts the device
object to some list.

I think that this is in order to avoid IoCreate/DeleteDevice in the
completion routine.

See SFILTER sample for details.

Max


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


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@windows.microsoft.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