From 3f68888c33d867bc877ed4168eaf375999199044 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 26 Nov 2007 22:12:04 +0000 Subject: [PATCH] DEVEL15-volprocs-alloc-vnode-instead-of-using-stack-20071126 don't use stack here; alloc memory for short term use (cherry picked from commit 4f98eb48fccde9dd70708b2dd6b0903745d16b7a) --- src/volser/volprocs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index a63b0f6c00..6e53cea8b5 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -203,14 +203,14 @@ ViceCreateRoot(Volume *vp) struct acl_accessList *ACL; ViceFid did; Inode inodeNumber, nearInode; - char buf[SIZEOF_LARGEDISKVNODE]; - struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf; + struct VnodeDiskObject *vnode; struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge]; IHandle_t *h; FdHandle_t *fdP; int code; afs_fsize_t length; + vnode = (struct VnodeDiskObject *)malloc(SIZEOF_LARGEDISKVNODE); memset(vnode, 0, SIZEOF_LARGEDISKVNODE); V_pref(vp, nearInode); @@ -275,6 +275,7 @@ ViceCreateRoot(Volume *vp) VNDISK_GET_LEN(length, vnode); V_diskused(vp) = nBlocks(length); + free(vnode); return 1; }