From: Jeffrey Hutzelman Date: Wed, 22 Jul 2009 14:19:28 +0000 (-0400) Subject: Fix afs_GetVolume() for non-root dynroot FIDs X-Git-Tag: openafs-stable-1_4_12pre1~150 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=dd7fd7140ef5f5852c28788eed8e821997f52be4;p=packages%2Fo%2Fopenafs.git Fix afs_GetVolume() for non-root dynroot FIDs 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 Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_dynroot.c b/src/afs/afs_dynroot.c index ba1bbe646..9a17bf196 100644 --- a/src/afs/afs_dynroot.c +++ b/src/afs/afs_dynroot.c @@ -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. */ diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 7ba69225c..ed08a99df 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -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); diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index d1290bd99..a6103ae96 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -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);