From 321a3635558eabe886816a556a11854bf40fac7c Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 11 Sep 2002 08:21:59 +0000 Subject: [PATCH] STABLE12-evalmountpoint-save-stack-20020909 use "small" memory pool instead of 128 bytes off the stack (cherry picked from commit 2656f417935a906a95bc07d401229405e8e5d9bd) --- src/afs/VNOPS/afs_vnop_lookup.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index c47181c95..7450763da 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -110,7 +110,7 @@ EvalMountPoint(avc, advc, avolpp, areq) struct VenusFid tfid; struct cell *tcell; char *cpos, *volnamep; - char type, buf[128]; + char type, *buf; afs_int32 prefetchRO; /* 1=>No 2=>Yes */ afs_int32 mtptCell, assocCell, hac=0; afs_int32 samecell, roname, len; @@ -179,15 +179,18 @@ EvalMountPoint(avc, advc, avolpp, areq) * Don't know why we do this. Would have still found it in above call - jpm. */ if (!tvp && (prefetchRO == 2)) { - strcpy(buf, volnamep); - afs_strcat(buf, ".readonly"); + buf = (char *)osi_AllocSmallSpace(strlen(volnamep)+10); - tvp = afs_GetVolumeByName(buf, mtptCell, 1, areq, WRITE_LOCK); + strcpy(buf, volnamep); + afs_strcat(buf, ".readonly"); - /* Try the associated linked cell if failed */ - if (!tvp && hac && areq->volumeError) { - tvp = afs_GetVolumeByName(buf, assocCell, 1, areq, WRITE_LOCK); - } + tvp = afs_GetVolumeByName(buf, mtptCell, 1, areq, WRITE_LOCK); + + /* Try the associated linked cell if failed */ + if (!tvp && hac && areq->volumeError) { + tvp = afs_GetVolumeByName(buf, assocCell, 1, areq, WRITE_LOCK); + } + osi_FreeSmallSpace(buf); } if (!tvp) return ENODEV; /* Couldn't find the volume */ -- 2.39.5