From: Derrick Brashear Date: Tue, 10 Sep 2002 05:00:52 +0000 (+0000) Subject: evalmountpoint-save-stack-20020909 X-Git-Tag: openafs-devel-1_3_50~618 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=2656f417935a906a95bc07d401229405e8e5d9bd;hp=a0e5dcbe59f948725f54788e8e6fee51d49ea8d1 evalmountpoint-save-stack-20020909 use "small" memory pool instead of 128 bytes off the stack --- diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 12e8006..6bde5de 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 */