[449] in arla-drinkers
Re: 12-28 snapshot on netbsd1.3H - much better luck this time
daemon@ATHENA.MIT.EDU (assar@stacken.kth.se)
Tue Dec 29 13:35:26 1998
From owner-arla-drinkers@stacken.kth.se Tue Dec 29 18:35:26 1998
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 4009 invoked from network); 29 Dec 1998 18:35:25 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
by bloom-picayune.mit.edu with SMTP; 29 Dec 1998 18:35:25 -0000
Received: (from majordom@localhost)
by sundance.stacken.kth.se (8.8.8/8.8.8) id TAA09475
for arla-drinkers-list; Tue, 29 Dec 1998 19:18:32 +0100 (MET)
Received: from assaris.sics.se (assaris.sics.se [193.10.66.108])
by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id TAA09471
for <arla-drinkers@stacken.kth.se>; Tue, 29 Dec 1998 19:18:29 +0100 (MET)
Received: (from assar@localhost) by assaris.sics.se (8.9.1/8.7.3) id TAA06102; Tue, 29 Dec 1998 19:19:08 +0100 (CET)
From: assar@stacken.kth.se
To: Ken Raeburn <raeburn@raeburn.org>
Cc: arla-drinkers@stacken.kth.se
Subject: Re: 12-28 snapshot on netbsd1.3H - much better luck this time
References: <199812291646.LAA07921@kr-pc.cygnus.com> <5lempiho24.fsf@assaris.sics.se> <tx1btkm4yvp.fsf@raeburn.org>
Mime-Version: 1.0 (generated by tm-edit 7.68)
Content-Type: multipart/mixed;
boundary="Multipart_Tue_Dec_29_19:19:05_1998-1"
Content-Transfer-Encoding: 7bit
Date: 29 Dec 1998 19:19:05 +0100
In-Reply-To: Ken Raeburn's message of "29 Dec 1998 12:54:50 -0500"
Message-ID: <5l90fqhkva.fsf@assaris.sics.se>
Lines: 113
X-Mailer: Gnus v5.5/Emacs 19.34
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk
--Multipart_Tue_Dec_29_19:19:05_1998-1
Content-Type: text/plain; charset=US-ASCII
Ken Raeburn <raeburn@raeburn.org> writes:
> Perhaps. Or accesses to /afs could be made to cause interruptible
> delays until it's initialized. That's probably harder, but would
> permit other system startup tasks that don't depend on AFS to run
> concurrently with the arla initialization.
Yes, that was actually the idea but it doesn't work quite that way.
> The source has multiple "#ifdef FOO / try syscall FOO / #endif"
> blocks, but from my disassembly, it appears that none are used in my
> installed copy. So the code is merely fiddling with signal handlers
> and returning a failure indication. My guess is that the macros it
> tests are intended to be hard-coded numbers, but I don't think they
> need to be. I'll look into it further.
Assuming it's not divulging any important secrets, could you tell me
the $Id$ from the file afssydefs.h. In my copy of the file the
following lines have been there since 1.5 (from 1995/12/02):
#if defined(__NetBSD__)
#define AFS_SYSCALL 210
#endif
> If the number 210 is magic for Transarc AFS on NetBSD, that would
> explain why the Transarc binaries I got from MIT seemed to work.
Right.
> But "fs sysname" reported "_nbsd13", which doesn't seem right. Is
> this all as expected?
No, that's wrong and that's caused by arlad sending just the string
and fs expecting a length (4 bytes) followed by the string. (The
documentation doesn't say anything about a length field...)
Patches for that follow.
/assar
--Multipart_Tue_Dec_29_19:19:05_1998-1
Content-Type: text/plain; charset=US-ASCII
Index: arlad/messages.c
===================================================================
RCS file: /usr/local/cvsroot/arla/arlad/messages.c,v
retrieving revision 1.110
diff -u -w -u -w -r1.110 messages.c
--- messages.c 1998/12/24 03:41:14 1.110
+++ messages.c 1998/12/29 18:15:51
@@ -2633,8 +2665,21 @@
arlasysname[h->insize] = '\0';
return xfs_send_message_wakeup(fd, h->header.sequence_num, 0);
} else {
- return xfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- arlasysname, strlen(arlasysname) + 1);
+ char *buf;
+ size_t sysname_len = strlen (arlasysname);
+ int ret;
+
+ buf = malloc (sysname_len + 4 + 1);
+ if (buf == NULL)
+ return xfs_send_message_wakeup (fd, h->header.sequence_num, ENOMEM);
+ *((u_int32 *)buf) = sysname_len;
+ memcpy (buf + 4, arlasysname, sysname_len);
+ buf[sysname_len + 4] = '\0';
+
+ ret = xfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
+ buf, sysname_len + 5);
+ free (buf);
+ return ret;
}
}
Index: appl/fs_lib.c
===================================================================
RCS file: /usr/local/cvsroot/arla/appl/fs_lib.c,v
retrieving revision 1.18
diff -u -w -u -w -r1.18 fs_lib.c
--- fs_lib.c 1998/12/23 03:49:50 1.18
+++ fs_lib.c 1998/12/29 18:17:13
@@ -525,16 +525,24 @@
{
struct ViceIoctl a_params;
int32_t set = 0;
+ char *buf;
+ buf = malloc (sys_sz + 4);
+ if (buf == NULL)
+ return ENOMEM;
+
a_params.in = (caddr_t)&set;
a_params.in_size = sizeof(set);
- a_params.out = sys;
- a_params.out_size = sys_sz;
+ a_params.out = buf;
+ a_params.out_size = sys_sz + 4;
if(k_pioctl (NULL, VIOC_AFS_SYSNAME, &a_params, 1) < 0)
return errno;
- else
+ else {
+ strncpy (sys, buf + 4, sys_sz - 1);
+ sys[sys_sz - 1] = '\0';
return 0;
+ }
}
/*
--Multipart_Tue_Dec_29_19:19:05_1998-1--