afs: test condition mismatch resolved 07/13207/4
authorPat Riehecky <riehecky@fnal.gov>
Tue, 12 Jun 2018 18:55:56 +0000 (13:55 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Tue, 2 Jul 2019 07:56:07 +0000 (03:56 -0400)
While it is unexpected, it is possible for the two disconnected flags to
get out of sync resulting in a path to an undefined varible in use.
(via cppcheck)

Change-Id: I995b402e73c2c330485050dd2594a62fe67d1bca
Reviewed-on: https://gerrit.openafs.org/13207
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/VNOPS/afs_vnop_create.c

index fe37eed..c4d7c70 100644 (file)
@@ -451,7 +451,7 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs,
            if (origCBs == finalCBs && origZaps == finalZaps) {
                tvc->f.states |= CStatd;        /* we've fake entire thing, so don't stat */
                tvc->f.states &= ~CBulkFetching;
-               if (!AFS_IS_DISCON_RW) {
+               if (!AFS_IS_DISCONNECTED && !AFS_IS_DISCON_RW) {
                    tvc->cbExpires = CallBack.ExpirationTime;
                    afs_QueueCallback(tvc, CBHash(CallBack.ExpirationTime), volp);
                }