Coda File System

Re: Venus dies when trying to access newly mounted volume

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Fri, 3 May 2002 17:04:04 -0400
On Fri, May 03, 2002 at 04:56:51PM -0400, Jan Harkes wrote:
> I normally don't ever see that message. It looks like an RVM transaction
> is started while there is already one active. My guess is that the
> ongoing transaction is where the "reinstalling" message is displayed.
> Now I just have to figure out where the second Recov_BeginTrans is
> called.

And the fix is...

Index: venusvol.cc
===================================================================
RCS file: /afs/cs/project/coda-src/cvs/coda/coda-src/venus/venusvol.cc,v
retrieving revision 4.71
diff -u -u -r4.71 venusvol.cc
--- venusvol.cc	2002/01/30 17:07:50	4.71
+++ venusvol.cc	2002/05/03 20:59:45
@@ -406,6 +406,7 @@
     return(0);
 }
 
+/* must NOT be called from within a transaction */
 static int GetVolReps(VolumeInfo *volinfo, volrep *volreps[VSG_MEMBERS])
 {
     int i, err = 0;
@@ -449,12 +450,15 @@
 
     /* Check whether the key is already in the database. */
     if ((v = Find(volinfo->Vid))) {
-	Recov_BeginTrans();
 	if (strncmp(v->name, volname, V_MAXVOLNAMELEN) != 0) {
 	    eprint("reinstalling volume %s (%s)", v->GetName(), volname);
 
+	    Recov_BeginTrans();
+
 	    rvmlib_set_range(v->name, V_MAXVOLNAMELEN);
 	    strcpy(v->name, volname);
+
+	    Recov_EndTrans(0);
 	}
 
         /* add code to support growing/shrinking VSG's for replicated volumes
@@ -464,6 +468,8 @@
 	    vp = (repvol *)v;
 	    err = GetVolReps(volinfo, volreps);
 	    if (!err) {
+		Recov_BeginTrans();
+
 		for (i = 0; i < VSG_MEMBERS; i++) {
 		    /* did the volume replica change? */
 		    if (vp->volreps[i] != volreps[i]) {
@@ -479,13 +485,12 @@
 			vp->Reconfigure();
 		    }
 		}
+		Recov_EndTrans(0);
 	    }
 	    /* put whatever volumes were unchanged */
 	    for (i = 0; i < VSG_MEMBERS; i++)
 		VDB->Put((volent **)&volreps[i]);
 	}
-
-	Recov_EndTrans(0);
 
 	return(v);
     }
Received on 2002-05-03 17:05:01