Tony - I have been following this conversation for a bit and there are some misconceptions I’d like to clear up.
Firstly - we have never encouraged the notion that minifilters are a panacea to all filter development complexities, nor that folks can now go and write them willy nilly. We keep a watch internally as well to first dissuade anybody from attempting a filter unless there is really no way around, and if it really has commensurate business benefits.
I have personally been successful in choosing alternate paths to writing file system filters in a number of cases.
However what mini-filters do is that make some problems that make a developer skilling developing file system filters go away. They are analogous what WDF is for drivers (minifilters preceded WDF), where the objective is to not encourage folks to develop more filters, but to make filter authoring free of certain complexities which could be resolved by a framework. Specifically these are:
- Ordering among filters - load order groups were not adequate as pretty much everybody on this mailing list is probably aware of, and altitudes help dynamic ordering and completely get rid of the problem.
- Boiler plate code. Avoiding mistakes in boiler plate code - we had tons of issues with filters not handling mount, or Acquire* calls.
- Complexity of IRP handling: there were some intricacies to forwarding IRPs and their control flow, and those have been eliminated.
- Context management and name space handling: a lot of filters got this completely wrong.
- Unload and reference counting: many filters were not even aware that they need to reference count IRPs to enable unload, and when they did, the performance overhead was high. Filter manager does automatic reference counting for callbacks and allows one to add their own references.
- User/Kernel communication library: a lot of filters keep re-rolling the same IOCTL based communication package, but don’t get the security and asynchronous/process exit semantics write.
- Reducing re-entrancy: FltCreateFile etc. allow one to ensure that accidental re-entrancy is prevented which is what filters need by and large.
However, filter manager does not help with cache manager/memory manager complexities - as they are part of the FS design complexity in Windows. We do have some longer term plans to simplify, but they are not appropriate to discuss here.
While I understand the resistance from the more experienced filter devs - such as you, Maxim - who understand all the details of the OS/FS complexity and can work around them using legacy filters, the majority of the filter developers - even before filter manager appeared on the scene, didn’t like the complexity and found a lot of the interfacing as a legacy filter quite unintuitive. There is no question, that we eliminated a whole bunch of standard issues that folks ran repeatedly into with filter manager and a majority of filters fit that pattern (in terms of numbers developed)
However there are always a somewhat complex, domain specific filter or one that needs to have intricate knowledge of the internals of the OS (which may not be documented) and you are willing to put up with the cost that brings with that. There are folks who still hook NT APIs or dig into private kernel structures, but that comes with a cost, and a support overhead that is significantly higher. Our goal is certainly to constantly clean up interactions which are problematic and make them more transparent if they are relevant for filters. I think you should send the specifics of what your requirements are and why you need that to Sarosh (unless you have already done that).
Thanks!
Ravi
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, January 19, 2009 9:05 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Forcing mini-filters (since this isn’t Win7 WDK anymore)
Indeed Max, my point was that it seems difficult to envision how one
would enforce the “no legacy filters except the one written by us”
model. Sarosh’s comment suggests that no mechanism has been decided
yet.
The filter we implemented recently needed to sit between MUP and RDR on
Vista. Since filter manager sits above MUP, a mini-filter cannot be
used to observe the interactions between MUP and RDR. A legacy filter
can be used to do that (ironically, it must also sit on top of MUP, a
trick we’ve used for 10+ years to discover network redirectors that
don’t register as file systems. But that’s a detail here.)
I suppose the “out” here is that one can argue about the definition of a
file system. In Vista, since RDR doesn’t register, we can argue that it
isn’t a file system, while because MUP registers it IS a file system.
If we restrict the definition in this way it could be policed in the
attachment code (“if this is a registered file system driver, only allow
the attach if it is filter manager.”) My concern is that this will
encourage people to use hacks to implement their functionality - they
certainly do that in other areas when an interface is unavailable.
Don’t get me wrong - I would suggest to ANYONE that is starting out
building a filter driver that they do so as a mini-filter unless there
is a compelling technical reason why it cannot be done within the
mini-filter framework. Compelling technical reasons include: supporting
legacy systems where filter manager does not exist and filtering
components that filter manager does not filter. The problem is that
while some of us have the technical expertise to choose the right path,
others joining the process now may not. Thus, the goal would be to
force those without that technical expertise to “choose the right path”
and to forcibly remove the option of doing things “correctly” for those
that do have the technical expertise.
For those that believe mini-filters are a panacea to filtering problems,
rest assured they are not. My observation has been that filter manager
makes building filters look deceptively easy, without actually making
the “hard part” of filtering (understanding file system behavior) any
easier. It has encouraged a greater number of people to build filter
drivers. Whether or not this equates to fewer interop issues is not
clear - perhaps fewer per filter but offset by more filters?
Tony
OSR
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com