From 2656f417935a906a95bc07d401229405e8e5d9bd Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 10 Sep 2002 05:00:52 +0000 Subject: [PATCH] evalmountpoint-save-stack-20020909 use "small" memory pool instead of 128 bytes off the stack --- 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 12e8006dc..6bde5de17 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -105,7 +105,7 @@ int EvalMountPoint(register struct vcache *avc, struct vcache *advc, 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; @@ -174,15 +174,18 @@ int EvalMountPoint(register struct vcache *avc, struct vcache *advc, * 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