Windows: cm_MergeStatus avoid lock recursion
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 27 Sep 2013 22:02:52 +0000 (18:02 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 28 Sep 2013 02:21:31 +0000 (19:21 -0700)
commit4f266f14c0721111a9d453c3358cddf77eb2641a
treea7ed3d81395cec30b857299f72c9bd2fffd236fc
parent7efd78539066bedeeb3b579a613d587d8aa6e623
Windows: cm_MergeStatus avoid lock recursion

It is possible for cm_MergeStatus() to be called while the
cm_buf_t.mx is already held.  If it is a panic occurs.  Test for
refcount == 0 before acquiring the lock in addition to afterwards.
If the refcount is not zero, then we do not need to acquire the
lock in any case.

Change-Id: I1b73a03f4745e524d7fdf8f9b231b420895ff0fa
Reviewed-on: http://gerrit.openafs.org/10297
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsd/cm_scache.c