From f2fbb398a439423e210d41f46a9433838b0a8fce Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Sat, 24 Feb 2001 15:35:05 +0000 Subject: [PATCH] afs-lookup-check-evalmountpoint-return-20010221 Make check the return code from EvalMountPoint() ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== maintain old behavior consistent with checking eval return --- src/afs/VNOPS/afs_vnop_lookup.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index aaed884d0..7df8f041d 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -127,7 +127,7 @@ EvalMountPoint(avc, advc, avolpp, areq) volnamep = &avc->linkData[1]; tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); } - if (!tcell) return ENODEV; + if (!tcell) return ENOENT; mtptCell = tcell->cell; /* The cell for the mountpoint */ if (tcell->lcellp) { @@ -182,7 +182,7 @@ EvalMountPoint(avc, advc, avolpp, areq) } } - if (!tvp) return ENOENT; /* Couldn't find the volume */ + if (!tvp) return ENODEV; /* Couldn't find the volume */ /* Don't cross mountpoint from a BK to a BK volume */ if ((avc->states & CBackup) && (tvp->states & VBackup)) { @@ -198,7 +198,7 @@ EvalMountPoint(avc, advc, avolpp, areq) tfid.Cell = tvp->cell; afs_PutVolume(tvp, WRITE_LOCK); /* release old volume */ tvp = afs_GetVolume(&tfid, areq, WRITE_LOCK); /* get the new one */ - if (!tvp) return ENOENT; /* oops, can't do it */ + if (!tvp) return ENODEV; /* oops, can't do it */ } if (avc->mvid == 0) @@ -1162,6 +1162,12 @@ afs_lookup(adp, aname, avcp, acred) ObtainWriteLock(&tvc->lock,133); code = EvalMountPoint(tvc, adp, &tvolp, &treq); ReleaseWriteLock(&tvc->lock); + + if (code) { + if (tvolp) afs_PutVolume(tvolp, WRITE_LOCK); + goto done; + } + /* next, we want to continue using the target of the mt point */ if (tvc->mvid && (tvc->states & CMValid)) { struct vcache *uvc; -- 2.39.5