[OpenAFS] missing init causes erratic results using the client's "hard mount" functionality

Rainer Toebbicke rtb@pclella.cern.ch
Thu, 3 Sep 2009 13:04:54 +0200


--------------090509030601090605010906
Content-Type: text/plain; charset="ISO-8859-15"; format=flowed
Content-Transfer-Encoding: 7bit

afs_InitReq fails to initialize the "flags" field of the vrequest structure.

Consequently the logic involving (flags & O_NONBLOCK) in afs_Analyze leads to 
unpredictable results. afs_InitReq should initialize the complete vrequest 
structure.

Patch attached, openafs-bugs bcc'd.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland
Phone: +41 22 767 8985       Fax: +41 22 767 7155

--------------090509030601090605010906
Content-Type: text/plain; name="p_init_Reqflags"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="p_init_Reqflags"

--- openafs/src/afs/afs_osi_pag.c.~	2009-09-03 12:01:11.000000000 +0200
+++ openafs/src/afs/afs_osi_pag.c	2009-09-03 12:01:12.000000000 +0200
@@ -429,17 +429,10 @@
 int
 afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred)
 {
-    int i = 0;
-
     AFS_STATCNT(afs_InitReq);
     if (afs_shuttingdown)
 	return EIO;
-    av->idleError = 0;
-    av->tokenError = 0;
-    while (i < MAXHOSTS) {
-	av->skipserver[i] = 0;
-	i++;
-    }
+    memset(av, 0, sizeof(*av));
     av->uid = PagInCred(acred);
     if (av->uid == NOPAG) {
 	/* Afs doesn't use the unix uid for anuthing except a handle
@@ -458,7 +451,6 @@
 	av->uid = acred->cr_ruid;	/* default when no pag is set */
 #endif
     }
-    av->initd = 0;
     return 0;
 }
 

--------------090509030601090605010906--