From 66c72e111dd5da44d4765486fecdbc3035a6d6a3 Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Tue, 6 Mar 2001 22:18:24 +0000 Subject: [PATCH] STABLE10-afs-lookup-check-evalmountpoint-return-20010221 (cherry picked from commit f2fbb398a439423e210d41f46a9433838b0a8fce) --- 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