Hi all, I meet a problem and I have been debug it for a long time, but did not find anything useful.
I’m doing an encryption filter based on layered fsd, the filter runs well for normal write requests, but it seems go into a deadlock when it meets a very large bytes write request(nearly about 10MB) which will lead to a AcquireForLazyWrite & PreAcquireForModWrite.
I add the DbgPrint for these two routines, the following is what I got:
KsPreAcquireForModWrite: Entry
KsAcquireForLazyWrite
KsReleaseFromLazyWrite
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsAcquireForLazyWrite
KsReleaseFromLazyWrite
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
KsAcquireForLazyWrite
KsReleaseFromLazyWrite
KsPreAcquireForModWrite: Entry
KsPreAcquireForModWrite: Entry
…
Does anyone know what may be the problem? Any help will be much appreciated!
I think everyone on this list knows by now that you are writing an
encryption filter. And I think a lot of it was probably created with
responses from Tony, Rod, et al.
Either way, as Tony told me previously, compiling FastFat and stepping
through in debug mode will go a long way in understanding the intricacies
when writing an isolation filter.
On Sun, Dec 7, 2014 at 10:36 PM, wrote:
> Hi all, I meet a problem and I have been debug it for a long time, but did
> not find anything useful.
> I’m doing an encryption filter based on layered fsd, the filter runs well
> for normal write requests, but it seems go into a deadlock when it meets a
> very large bytes write request(nearly about 10MB) which will lead to a
> AcquireForLazyWrite & PreAcquireForModWrite.
> I add the DbgPrint for these two routines, the following is what I got:
> KsPreAcquireForModWrite: Entry
> KsAcquireForLazyWrite
> KsReleaseFromLazyWrite
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsAcquireForLazyWrite
> KsReleaseFromLazyWrite
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> KsAcquireForLazyWrite
> KsReleaseFromLazyWrite
> KsPreAcquireForModWrite: Entry
> KsPreAcquireForModWrite: Entry
> …
> Does anyone know what may be the problem? Any help will be much
> appreciated!
>
> —
> NTFSD is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of debugging and file system seminars 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
>
Thanks Paul.
I follow your advice, it is really useful. After debugging on fastfat, I think it is not IRP_MJ_ACQUIRE_FOR_MOD_WRITE’s problem, because I didn’t see this kind of requests at all.
I find that only call CcCopyWrite for a large file can lead to this problem, in fact there are a serious of PagingIoWrite followed, but finally it run into a wrong address and got an Access violation.
I try to search some related articles, but didn’t find anything useful, is there anything I need to take care of before calling CcCopyWrite for a large file?
I have fixed this problem, it is because my filter set file size after the CcInitializeCacheMap, so it try to read some random memory.
Thanks for all of your hlep!