Windows: fix cm_DirOpDelBuffer assert
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 3 Feb 2012 16:21:45 +0000 (11:21 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 3 Feb 2012 21:36:45 +0000 (13:36 -0800)
In cm_DirOpDelBuffer() the data version field for a buffer
in cm_dirOp_t.buffers[] can be CM_BUF_VERSION_BAD if the buffer
was added to the buffer list but was never fetched from the file
server.  If the buffer was recycled by buf_Get() an attempt to
remove an entry from the directory will be failed as opposed to
fetching the buffer from the file server and performing the local
removal.

Change-Id: Id9af5180f2176c2a90ef9907ae84139e66ffe5d6
Reviewed-on: http://gerrit.openafs.org/6650
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsd/cm_dir.c

index c0a6a2f..534b85f 100644 (file)
@@ -1424,7 +1424,7 @@ cm_DirOpDelBuffer(cm_dirOp_t * op, cm_buf_t * bufferp, int flags)
                          (op->lockType == CM_DIRLOCK_WRITE ? CM_SCACHESYNC_WRITE : CM_SCACHESYNC_READ));
 
 #ifdef DEBUG
-            osi_assert(bufferp->dataVersion == op->dataVersion);
+            osi_assert(bufferp->dataVersion == op->dataVersion || bufferp->dataVersion == CM_BUF_VERSION_BAD);
 #endif
 
             lock_ReleaseWrite(&op->scp->rw);