[OpenAFS] System still panicing.. no help found yet..
Nickolai Zeldovich
kolya@MIT.EDU
Thu, 14 Mar 2002 13:38:48 -0500
> Here is the stack trace...
Thanks.. Could you try this patch and see if it helps?
(Note that I've not actually tested it, so you may want
to first check it on a different machine.) This should
be against openafs-1.2.3.
-- kolya
--- src/afs/VNOPS/afs_vnop_symlink.c 2002/01/20 08:20:57 1.4.4.1
+++ src/afs/VNOPS/afs_vnop_symlink.c 2002/03/14 18:36:36
@@ -224,7 +224,7 @@
struct vrequest *areq;
{
register struct dcache *tdc;
- register char *tp;
+ register char *tp, *rbuf;
afs_int32 offset, len, alen;
register afs_int32 code;
@@ -245,10 +245,14 @@
}
if (avc->m.Mode & 0111) alen = len+1; /* regular link */
else alen = len; /* mt point */
- tp = afs_osi_Alloc(alen); /* make room for terminating null */
+ rbuf = (char *) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
addr = afs_MemCacheOpen(tdc->f.inode);
- code = afs_MemReadBlk(addr, 0, tp, len);
- tp[alen-1] = 0;
+ code = afs_MemReadBlk(addr, 0, rbuf, len);
+ rbuf[alen-1] = '\0';
+ alen = strlen(rbuf) + 1;
+ tp = afs_osi_Alloc(alen); /* make room for terminating null */
+ memcpy(tp, rbuf, alen);
+ osi_FreeLargeSpace(rbuf);
afs_PutDCache(tdc);
if (code != len) {
afs_osi_Free(tp, alen);
@@ -263,7 +267,7 @@
register struct vcache *avc;
struct vrequest *areq; {
register struct dcache *tdc;
- register char *tp;
+ register char *tp, *rbuf;
char *tfile;
afs_int32 offset, len, alen;
register afs_int32 code;
@@ -285,11 +289,15 @@
tfile = osi_UFSOpen (tdc->f.inode);
if (avc->m.Mode & 0111) alen = len+1; /* regular link */
else alen = len; /* mt point */
- tp = afs_osi_Alloc(alen); /* make room for terminating null */
- code = afs_osi_Read(tfile, -1, tp, len);
- tp[alen-1] = 0;
+ rbuf = (char *) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ code = afs_osi_Read(tfile, -1, rbuf, len);
+ rbuf[alen-1] = '\0';
osi_UFSClose(tfile);
afs_PutDCache(tdc);
+ alen = strlen(rbuf) + 1;
+ tp = afs_osi_Alloc(alen); /* make room for terminating null */
+ memcpy(tp, rbuf, alen);
+ osi_FreeLargeSpace(rbuf);
if (code != len) {
afs_osi_Free(tp, alen);
return EIO;