How to Disable SMB2 Caching on a per application basis, or how to detect SMB2 ? RRS feed

  • Question

  • In a large legacy application, a lot of multiuser synchronisation is happening using a simple system whereby a workstation makes a file on the network and expects other workstations to see this file.  The original workstation deletes the file when other workstations are free to proceed.  A sort of rudimentary cross-workstation Mutex in other words.

    This worked well enough so far, but is now broken when SMB2.0 is in use (Server 2008 + Vista clients).

    Due to this being legacy, I can't afford to rewrite and spend a lot of time on this.

    Now... while a lot of places this sort of checks are done, there's only a few places that are actually trying to prevent access.  So I see several ways out of this...

    1) Disable SMB2.0 caching for the application only.  Disabling SMB2 entirely is a performance penalty I'm not sure we can impose upon the users (I doubt it)...  Is this possible ?
    2) Somehow 'force' a reread of the cache, But since checking happens a lot, I can't afford just waiting the timeout period here. It does need to force a reread "now".  Is this possible ?
    3) Is it possible to detect that connection to a specific server is happening with SMB2 ?  Since the actions that impose restrictions are rather limited, I could get my way out with a simple messabox and a disclaimer and some minor tweaks to the code (not ideal, but acceptable in this case).  But I don't want to give this messagebox when I don't have to.

    Wednesday, September 9, 2009 3:00 PM