Filter driver causes checkdisk to run on FAT32 volumes

Hi,

I have a problem with my filter driver and I do not know how to resolve it.
The driver intercepts mount requests and attaches to the newly mounted
volume. It also creates a shadow device for the volume. Before returning
from the mount dispatch it queues a work item to complete the volume-
related initialization.
The driver performs some file I/O in the work item routine, in particular,
it deletes some files and directories from the volume via its shadow device.
At the end it sets the notification event, indicating that the
initialization is
completed and alowing filter’s create entry point to proceed with create
irps.

It works well on NT4 (NTFS and FAT).

But under Win2k it causes CHECKDISK to run on FAT32 volumes.
It happens each time the driver performs any I/O in its work item routine.

Could you explain me why does it happens and is it possible and how to
avoid this.

I will be very appreciated for any help. Thanks in advance.

Leonid.

Some points to add:

  • The result of running the CHECKDISK is a number of files
    (saved as lost cluster chains), which just have been deleted
    by the filter driver in its work item routine.

  • It seems, that there is no visible problems if disk checking
    is canceled manually (but, probably, they can appear later).

Leonid.

Hi,

You can try to postpone your volume cleanup process until IO manager
learns that volume was mounted successfully. I think the best time to do
this cleanup is when the create request that triggered mount process comes
to filter - you can hold this IRP, do your cleanup and pass this request
through.

Alexei.

Alexei,

Thank you very much, I will try to implement it in this way.

Regards,
Leonid.

Oh, well. I’ve done it, but it doesn’t help.

Does anybody know, when chkdsk is launched (before mount volume
returns to I/O Manager or after) and by whom?

Any help is highly appreciated. Thanks in advance.

Leonid.

“Alexei Jelvis” wrote in message news:xxxxx@ntfsd…
>
> Hi,
>
> You can try to postpone your volume cleanup process until IO manager
> learns that volume was mounted successfully. I think the best time to do
> this cleanup is when the create request that triggered mount process comes
> to filter - you can hold this IRP, do your cleanup and pass this request
> through.
>
> Alexei.
>
>

Hi,

OK, you can try this: in W2K there is FSCTL_IS_VOLUME_DIRTY that returns
information if volume is dirty. Probably this FSCTL is used to decide to
start chkdsk. In order to mark volume clean you can try to lock and then
unlock it ( FSCTL_LOCK_VOLUME ) after you did your cleanup. Or you can use
IRP_MJ_FLUSH_BUFFERS to flush volume.

Alexei.

Oh, well. I’ve done it, but it doesn’t help.

Does anybody know, when chkdsk is launched (before mount volume
returns to I/O Manager or after) and by whom?

Any help is highly appreciated. Thanks in advance.

Leonid.