Robert Watson | 16 Feb 2008 05:12
Picon
Favicon

Patches to get Arla running on FreeBSD 8-CURRENT


Dear Arla folk,

I've spent the evening getting Arla (checked out of anoncvs) up and running on 
FreeBSD 8-CURRENT, and have it at least minimally running (/afs mounted, some 
directory access, read a few files, etc), although arlad core dumped fairly 
quickly during use.  I've not yet attempted to debug that problem though.

I've attached a patch that does a few things:

First, it does a few minor Arla cleanups that appear to be necessary to build 
on FreeBSD 8: A few general Arla ifdef fixes, etc, such as testing 
defined(SunOS) before using the value, likewise on __NetBSD_Version__, 
OpenBSD, etc. Fix two build dependency issues I ran into regarding building 
arlalib before dependent tools and an include that broke (at least on 
FreeBSD).

Second, it adds new autoconf and ifdef parts to get Arla building on FreeBSD 
8, such as handling VFS changes that appeared in FreeBSD 7.x and 8.x, the 
priv(9) kernel privilege framework, some include problems I ran into with 
using /usr/src/sys before /usr/include/sys (which doesn't work for generated 
files such as vnode_if.h), and things along those lines.

Unfortunately, I'm not set up to easily build test on other platforms, and 
I've also not had a chance to try this on FreeBSD 7 -- my guess is some minor 
tweaks may be required with respect to both of those, but hopefully these are 
steps in the right direction and someone with a bit more Arla experience can 
sort out what I've done into things with keeping and things with fixing :-). 
I'll investigate the arlad crash tomorrow.

(Continue reading)

Robert Watson | 17 Feb 2008 13:16
Picon
Favicon

Remove kafs.h include from nnpfs_syscalls-wrap-freebsd.c


Dear Arla Folk,

The attached patch removes the one include dependency of the nnpfs kernel 
module on Heimdal userspace includes.  I believe it's unnecessary, as it looks 
like someone has already done the work to create arla-pioctl.h, and I assume 
that same someone is making sure it remains in sync with kafs.h.

Robert N M Watson
Computer Laboratory
University of Cambridge

---------- Forwarded message ----------
Date: Sun, 17 Feb 2008 12:14:13 GMT
From: Robert Watson <rwatson <at> FreeBSD.org>
To: Perforce Change Reviews <perforce <at> freebsd.org>
Subject: PERFORCE change 135556 for review

http://perforce.freebsd.org/chv.cgi?CH=135556

Change 135556 by rwatson <at> rwatson_cinnamon_coda on 2008/02/17 12:13:47

 	Remove unnecessary include of kafs.h, which removes all
 	dependency on kerberos files from the nnpfs kernel module on
 	FreeBSD

Affected files ...

.. //depot/user/rwatson/arla/porting/nnpfs/bsd/nnpfs_syscalls-wrap-freebsd.c#2 edit

(Continue reading)

Rasmus Kaj | 17 Feb 2008 23:21
Picon
Picon
Favicon
Gravatar

Re: Patches to get Arla running on FreeBSD 8-CURRENT

lör 2008-02-16 klockan 04:12 +0000 skrev Robert Watson:

Hi Robert and Arla folks!

> I've spent the evening getting Arla (checked out of anoncvs) [...]

Everyone who got Arla out of anoncvs, please update!

The anoncvs repo has been out of sync since october 1, 2007.  Now it is
updated -- and updating itself when new commits happen -- again.

Sorry for the inconvenience!

--

-- 
Rasmus Kaj <kaj <at> kth.se>
Robert Watson | 18 Feb 2008 02:29
Picon
Favicon

Re: Patches to get Arla running on FreeBSD 8-CURRENT

On Sun, 17 Feb 2008, Rasmus Kaj wrote:

>> I've spent the evening getting Arla (checked out of anoncvs) [...]
>
> Everyone who got Arla out of anoncvs, please update!
>
> The anoncvs repo has been out of sync since october 1, 2007.  Now it is 
> updated -- and updating itself when new commits happen -- again.
>
> Sorry for the inconvenience!

Indeed, all the missing changes from October through December are now there in 
anoncvs.  Looks like the appl/lib build order fix I needed is already there, 
but most of the other changes haven't been bumped into by anyone else yet.  I 
needed the one further attached change to correct a build problem resulting 
from the more recent work in CVS.  With the updated parts, I now have Arla 
running on FreeBSD 8-CURRENT again.

Robert N M Watson
Computer Laboratory
University of Cambridge

http://perforce.freebsd.org/chv.cgi?CH=135612

Change 135612 by rwatson <at> rwatson_cinnamon_coda on 2008/02/18 01:04:20

 	New build fix for NetBSDism in Arla.

Affected files ...

(Continue reading)

Robert Watson | 18 Feb 2008 02:46
Picon
Favicon

Patch: connect fs.1 to the build


The attached patch will cause automake to install the fs.1 man page with make 
install; possibly this was lost during the automake conversion in 2005?

Robert N M Watson
Computer Laboratory
University of Cambridge

---------- Forwarded message ----------
Date: Mon, 18 Feb 2008 01:44:04 GMT
From: Robert Watson <rwatson <at> FreeBSD.org>
To: Perforce Change Reviews <perforce <at> freebsd.org>
Subject: PERFORCE change 135615 for review

http://perforce.freebsd.org/chv.cgi?CH=135615

Change 135615 by rwatson <at> rwatson_cinnamon_coda on 2008/02/18 01:43:14

 	Hook up fs.1 to the build.install.

Affected files ...

.. //depot/user/rwatson/arla/porting/appl/fs/Makefile.am#2 edit

Differences ...

==== //depot/user/rwatson/arla/porting/appl/fs/Makefile.am#2 (text+ko) ====

 <at>  <at>  -73,3 +73,5  <at>  <at> 
  	$(RXKAD_LIBS) \
(Continue reading)

Alec Kloss | 22 Feb 2008 13:52
Favicon

Re: Patches to get Arla running on FreeBSD 8-CURRENT

Robert, I've been playing with your patches, etc. on 8-CURRENT.
I've been having to tweak up include/config.h a little so I wonder
if you missed a few autoconf things... but more important, running
"ls /afs" results in:

nnpfs: cdev: 0, syscall: 339

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x26c
fault code              = supervisor read, page not present
instruction pointer     = 0x20:0xc2a7f1fc
stack pointer           = 0x28:0xcd412a40
frame pointer           = 0x28:0xcd412a5c
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 4822 (ls)
[thread pid 4822 tid 100176 ]
Stopped at      nnpfs_getattr_common+0xc:       movl
0x26c(%eax),%eax
db> bt
Tracing pid 4822 tid 100176 td 0xc2783440
nnpfs_getattr_common(c297b110,cd412ab4,c24f1700,c2783440,cd412aa0,...) at nnpfs_getattr_common+0xc
nnpfs_getattr(cd412aa0,0,c0b10208,cd412b48,cd412b28,...) at nnpfs_getattr+0x33
VOP_GETATTR_APV(c2a854a0,cd412aa0,c0bd91a0,c297b110,cd412ab4,...) at VOP_GETATTR_APV+0xa5
vn_stat(c297b110,cd412b48,c24f1700,0,c2783440,...) at vn_stat+0x49
kern_stat(c2783440,8113138,0,cd412c18,c0c5d140,...) at kern_stat+0x81
stat(c2783440,cd412cfc,8,cd412d38,c0ba1e60,...) at stat+0x2f
syscall(cd412d38) at syscall+0x2b3
(Continue reading)

Alec Kloss | 22 Feb 2008 14:50
Favicon

Re: Patches to get Arla running on FreeBSD 8-CURRENT

On 2008-02-22 06:52,  wrote:
> Robert, I've been playing with your patches, etc. on 8-CURRENT.
[chop]

I take it back... boldly adding printf all over says:

	vp->v_mount is null

in the NNPFS_FROM_VNODE macro.

Adding if (vp->v_mount) return EDOOFUS does:

ls: /afs: Programming error

Attempting to umount /afs then panics most likely for the same
reason (v_mount is null):

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x26c
fault code              = supervisor read, page not present
instruction pointer     = 0x20:0xc2a26dfc
stack pointer           = 0x28:0xcd49bb00
frame pointer           = 0x28:0xcd49bb2c
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 5754 (umount)
[thread pid 5754 tid 100206 ]
Stopped at      nnpfs_inactive_common+0xc:      movl
(Continue reading)

Robert Watson | 23 Feb 2008 10:28
Picon
Favicon

Re: Patches to get Arla running on FreeBSD 8-CURRENT

On Fri, 22 Feb 2008, Alec Kloss wrote:

> Robert, I've been playing with your patches, etc. on 8-CURRENT. I've been 
> having to tweak up include/config.h a little so I wonder if you missed a few 
> autoconf things... but more important, running "ls /afs" results in:

This is a symptom of a failure to insmntque a vnode after creating it, a new 
requirement for vnodes in FreeBSD 7.x/8.x; previously, vnodes were 
automatically inserted on the mount vnode queue and had their mount pointer 
set up during getnewvnode(), but closing certain races motivated this change. 
The reason I know this is that I remember adding two calls to insmntque to 
nnpfs in my patches, so there are three possibilities: (1) I missed a call to 
getnewvnode, (2) the patches I posted didn't include that change, or (3) the 
patch didn't apply properly.  I'll investigate this later today once I've 
given my FOSDEM talk; chances are it's an issue with the patch.

Robert N M Watson
Computer Laboratory
University of Cambridge

>
> nnpfs: cdev: 0, syscall: 339
>
>
> Fatal trap 12: page fault while in kernel mode
> cpuid = 0; apic id = 00
> fault virtual address   = 0x26c
> fault code              = supervisor read, page not present
> instruction pointer     = 0x20:0xc2a7f1fc
> stack pointer           = 0x28:0xcd412a40
(Continue reading)

Alec Kloss | 23 Feb 2008 11:29
Favicon

Re: Patches to get Arla running on FreeBSD 8-CURRENT

On 2008-02-23 09:28, Robert Watson wrote:
> This is a symptom of a failure to insmntque a vnode after creating it, a 
> new requirement for vnodes in FreeBSD 7.x/8.x; previously, vnodes were 
> automatically inserted on the mount vnode queue and had their mount pointer 
> set up during getnewvnode(), but closing certain races motivated this 
> change. The reason I know this is that I remember adding two calls to 
> insmntque to nnpfs in my patches, so there are three possibilities: (1) I 
> missed a call to getnewvnode, (2) the patches I posted didn't include that 
> change, or (3) the patch didn't apply properly.  I'll investigate this 
> later today once I've given my FOSDEM talk; chances are it's an issue with 
> the patch.

Check.  The issue is with configure, etc.  include/config.h doesn't have

#define HAVE_KERNEL_INSMNTQUE 1 

in it.  I'll add it to my list of configure-related issues.
Recompiling now...

--

-- 
Alec Kloss  alec <at> SetFilePointer.com   IM: angryspamhater <at> yahoo.com
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo
_______________________________________________
Arla-drinkers mailing list
Arla-drinkers <at> stacken.kth.se
https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers
(Continue reading)

Alec Kloss | 23 Feb 2008 12:05
Favicon

Re: Patches to get Arla running on FreeBSD 8-CURRENT

On 2008-02-23 04:29, Alec wrote:
> 
> #define HAVE_KERNEL_INSMNTQUE 1 
> 
> in it.  I'll add it to my list of configure-related issues.
> Recompiling now...
> 

oldothello% uname -a
FreeBSD oldothello.setfilepointer.com 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Wed Feb 20 13:45:22 CST
2008 root <at> oldothello.setfilepointer.com:/usr/local/obj/usr/src/sys/GENERIC
i386
oldothello% ls /afs
andrew.cmu.edu      grand.central.org   openafs.org
athena.mit.edu      hallf.kth.se        research.company.com
cern.ch         isk.kth.se      rose-hulman.edu
deek.org        it.kth.se       setfilepointer.com
dementia.org        md.kth.se       stacken.kth.se
dev.mit.edu     mech.kth.se
e.kth.se        mekinok.com
oldothello%

Neat!  Heimdal gets tokens correctly, access to private directories
works.  I'm running the arla test suite now;  I'm up to hardlink3
with no problems.  I did notice that, when umounting /afs, I get
a lock order reversal:

lock order reversal:
 1st 0xc231329c vfslock (vfslock)  <at>  /usr/src/sys/kern/vfs_mount.c:1242
 2nd 0xc2dabaf8 syncer (syncer)  <at>  /usr/src/sys/kern/vfs_subr.c:2156
(Continue reading)


Gmane