]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Fix afs_GetVolume() for non-root dynroot FIDs
authorJeffrey Hutzelman <jhutz@cmu.edu>
Wed, 22 Jul 2009 14:19:28 +0000 (10:19 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 22 Jul 2009 17:05:52 +0000 (10:05 -0700)
Make afs_GetVolume() correctly handle requests for fids which are in
the dynroot cell but are not the root of the dynamic root volume.  This
is necessary to allow dynamic root mount points to be looked up and
followed in situations where the dynroot volume is not in the volcache,
but its root vnode is in the vcache.

Reviewed-on: http://gerrit.openafs.org/http://gerrit.openafs.org/180
Tested-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/afs/afs_dynroot.c
src/afs/afs_prototypes.h
src/afs/afs_volume.c

index ba1bbe646fdbaf8a47e99f756205e925bc25223b..9a17bf196cd918ad89da3cdd92e6c6a73182dc05 100644 (file)
@@ -130,6 +130,13 @@ afs_IsDynrootFid(struct VenusFid *fid)
            && fid->Fid.Unique == AFS_DYNROOT_UNIQUE);
 }
 
+int
+afs_IsDynrootAnyFid(struct VenusFid *fid)
+{
+    return (afs_dynrootEnable && fid->Cell == afs_dynrootCell
+           && fid->Fid.Volume == AFS_DYNROOT_VOLUME);
+}
+
 /*
  * Obtain the magic dynroot volume Fid.
  */
index 7ba69225cb603d0853b39cdf82e6fa270114a149..ed08a99df23df25754a0ec5126ad839cce6dcc2a 100644 (file)
@@ -345,6 +345,7 @@ extern int afs_InitCacheFile(char *afile, ino_t ainode);
 
 /* afs_dynroot.c */
 extern int afs_IsDynrootFid(struct VenusFid *fid);
+extern int afs_IsDynrootAnyFid(struct VenusFid *fid);
 extern void afs_GetDynrootFid(struct VenusFid *fid);
 extern int afs_IsDynroot(struct vcache *avc);
 extern void afs_DynrootInvalidate(void);
index d1290bd99d4cc0003300b1c3ee2b08bfdc488072..a6103ae96636ea9e4f8fc3f3ea31b6beb0df9549 100644 (file)
@@ -430,7 +430,7 @@ afs_GetVolume(struct VenusFid *afid, struct vrequest *areq,
 
     tv = afs_FindVolume(afid, locktype);
     if (!tv) {
-       if (afs_IsDynrootFid(afid)) {
+       if (afs_IsDynrootAnyFid(afid)) {
            tv = afs_NewDynrootVolume(afid);
        } else {
            bp = afs_cv2string(&tbuf[CVBS], afid->Fid.Volume);