Patches to get Arla running on FreeBSD 8-CURRENT

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 - 3 | Next >

Patches to get Arla running on FreeBSD 8-CURRENT

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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.

Patch also up at:

   http://www.watson.org/~robert/freebsd/20080216-arla.diff

Robert N M Watson
Computer Laboratory
University of Cambridge
[20080216-arla.diff]

Index: Makefile.am
===================================================================
RCS file: /stacken-cvs/arla/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- Makefile.am 25 Jan 2007 11:23:05 -0000 1.5
+++ Makefile.am 16 Feb 2008 03:49:49 -0000
@@ -19,6 +19,7 @@
  lib/bufdir \
  $(rxkad) \
  nnpfs \
+ appl/lib \
  arlad \
  conf \
  appl \
Index: configure.in
===================================================================
RCS file: /stacken-cvs/arla/configure.in,v
retrieving revision 1.758
diff -u -r1.758 configure.in
--- configure.in 25 Jan 2007 09:28:46 -0000 1.758
+++ configure.in 16 Feb 2008 03:49:52 -0000
@@ -396,7 +396,7 @@
   KERNEL=`sysctl -n kern.bootfile`
   AC_WERROR(BSD_WERROR)
   NNPFS_SUBDIR=freebsd
-  KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
+  KERNEL_INCLUDE=-I/usr/include -I`(cd $srcdir; pwd)`/nnpfs/bsd
   KERNEL_SRCS='bsd-subr.c'
 
   KERNEL=`sysctl -n kern.bootfile`
@@ -433,7 +433,7 @@
  esac
  shift
   done
-  KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -I. $defs${defs:+ }$flags${flags:+ }$incl"
+  KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -I/usr/include -I. $defs${defs:+ }$flags${flags:+ }$incl"
   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
   KERNEL_LD='ld'
 
@@ -867,6 +867,7 @@
  sys/mutex.h \
  sys/param.h \
  sys/prctl.h \
+ sys/priv.h \
  sys/poll.h \
  sys/pool.h \
  sys/queue.h \
@@ -1356,11 +1357,13 @@
 udev2dev \
 snprintf \
 suser_ucred \
+priv_check \
 namei_hash \
 nosys \
 sys_nosys \
 sys_lkmnosys \
 cache_purgevfs \
+insmntque \
 ])
 AC_CHECK_KERNEL_FUNC(memcpy, [0,0,0])
 
@@ -1446,8 +1449,12 @@
 AC_CHECK_KERNEL_VOP_T
 AC_BSD_FUNC_VFS_OBJECT_CREATE
 AC_BSD_FUNC_VOP_LOCK
+AC_BSD_FUNC_VOP_UNLOCK
+AC_BSD_FUNC_VOP_OPEN
 AC_BSD_FUNC_VFS_BUSY
+AC_BSD_FUNC_VFS_QUOTACTL
 AC_BSD_FUNC_VGET
+AC_BSD_FUNC_VNODE_CREATE_VOBJECT
 AC_BSD_FUNC_SUSER
 AC_BSD_FUNC_VFS_GETNEWFSID
 AC_BSD_FUNC_LOCKMGR
Index: appl/fs/fs_local.h
===================================================================
RCS file: /stacken-cvs/arla/appl/fs/fs_local.h,v
retrieving revision 1.38
diff -u -r1.38 fs_local.h
--- appl/fs/fs_local.h 16 Mar 2006 14:38:28 -0000 1.38
+++ appl/fs/fs_local.h 16 Feb 2008 03:49:53 -0000
@@ -43,7 +43,6 @@
 #endif
 #include <parse_units.h>
 #include <nnpfs/nnpfs_debug.h>
-#include <nnpfs/nnpfs_deb.h>
 #include <arladeb.h>
 
 #include <vers.h>
Index: cf/bsd-vfs-quotactl.m4
===================================================================
RCS file: cf/bsd-vfs-quotactl.m4
diff -N cf/bsd-vfs-quotactl.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cf/bsd-vfs-quotactl.m4 16 Feb 2008 03:49:53 -0000
@@ -0,0 +1,38 @@
+dnl
+dnl $Id$
+dnl
+
+dnl
+dnl Find out if VFS_QUOTACTL accepts a void * or a caddr_t argument.
+dnl
+
+AC_DEFUN([AC_BSD_FUNC_VFS_QUOTACTL], [
+AC_CACHE_CHECK(if VFS_QUOTACTL takes caddr_t argument, ac_cv_func_vfs_quotactl_caddr,
+AC_TRY_COMPILE_KERNEL([
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/vnode.h>
+#include <sys/mount.h>
+
+vfs_quotactl_t foo_quotactl;
+
+int
+foo_quotactl(struct mount *mp, int cmds, uid_t uid, caddr_t arg,
+    struct thread *td)
+{
+
+ return (0);
+}
+],[],
+ac_cv_func_vfs_quotctl_caddr=yes,
+ac_cv_func_vfs_quotactl_caddr=no))
+if test "$ac_cv_func_vfs_quotactl_caddr" = yes; then
+ AC_DEFINE(HAVE_VFS_QUOTACTL_CADDR, 1,
+ [define if VFS_QUOTACTL takes a caddr_t argument])
+fi
+])
Index: cf/bsd-vnode-create-vobject.m4
===================================================================
RCS file: cf/bsd-vnode-create-vobject.m4
diff -N cf/bsd-vnode-create-vobject.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cf/bsd-vnode-create-vobject.m4 16 Feb 2008 03:49:53 -0000
@@ -0,0 +1,28 @@
+dnl
+dnl $Id$
+dnl
+
+dnl
+dnl Find out if vnode_create_vobject() takes one argument or two on BSD; if
+dnl two then we need to use vnode_create_vobject_off() instead.
+dnl
+
+AC_DEFUN([AC_BSD_FUNC_VNODE_CREATE_VOBJECT], [
+AC_CACHE_CHECK(if vnode_create_vobject takes three arguments, ac_cv_func_vnode_create_vobject,
+AC_TRY_COMPILE_KERNEL([
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/vnode.h>
+],[vnode_create_vobject(0, 0, 0)],
+ac_cv_func_vnode_create_vobject_three_args=yes,
+ac_cv_func_vnode_create_vobject_three_args=no))
+if test "$ac_cv_func_vnode_create_vobject_three_args" = yes; then
+ AC_DEFINE(HAVE_THREE_ARGUMENT_VNODE_CREATE_VOBJ, 1,
+ [define if vnode_create_vobject takes three arguments])
+fi
+])
Index: cf/bsd-vop-open.m4
===================================================================
RCS file: cf/bsd-vop-open.m4
diff -N cf/bsd-vop-open.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cf/bsd-vop-open.m4 16 Feb 2008 03:49:53 -0000
@@ -0,0 +1,28 @@
+dnl
+dnl $Id$
+dnl
+
+dnl
+dnl Find out if VOP_OPEN takes a struct file or an integer final argument on
+dnl FreeBSD.
+dnl
+
+AC_DEFUN([AC_BSD_FUNC_VOP_OPEN], [
+AC_CACHE_CHECK(if VOP_OPEN takes a struct file final argument, ac_cv_func_vop_open_file_arg,
+AC_TRY_COMPILE_KERNEL([
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/vnode.h>
+],[VOP_OPEN(NULL, 0, NULL, NULL, (struct file *)NULL)],
+ac_cv_func_vop_open_file_arg=yes,
+ac_cv_func_vop_open_file_arg=no))
+if test "$ac_cv_func_vop_open_file_arg" = yes; then
+ AC_DEFINE(HAVE_FINAL_ARG_FILE_VOP_OPEN, 1,
+ [define if VOP_OPEN takes a file final argument])
+fi
+])
Index: cf/bsd-vop-unlock.m4
===================================================================
RCS file: cf/bsd-vop-unlock.m4
diff -N cf/bsd-vop-unlock.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cf/bsd-vop-unlock.m4 16 Feb 2008 03:49:53 -0000
@@ -0,0 +1,45 @@
+dnl
+dnl $Id$
+dnl
+
+dnl
+dnl Find out if VOP_UNLOCK takes two or three arguments
+dnl
+
+AC_DEFUN([AC_BSD_FUNC_VOP_UNLOCK], [
+AC_CACHE_CHECK(if VOP_UNLOCK takes two arguments, ac_cv_func_vop_unlock_two_args,
+AC_TRY_COMPILE_KERNEL([
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/vnode.h>
+],[VOP_UNLOCK(0, 0)],
+ac_cv_func_vop_unlock_two_args=yes,
+ac_cv_func_vop_unlock_two_args=no))
+if test "$ac_cv_func_vop_unlock_two_args" = yes; then
+ AC_DEFINE(HAVE_TWO_ARGUMENT_VOP_UNLOCK, 1,
+ [define if VOP_UNLOCK takes two arguments])
+fi
+
+AC_CACHE_CHECK(if VOP_UNLOCK takes three arguments, ac_cv_func_vop_unlock_three_args,
+AC_TRY_COMPILE_KERNEL([
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/vnode.h>
+],[VOP_UNLOCK(0, 0, 0)],
+ac_cv_func_vop_unlock_three_args=yes,
+ac_cv_func_vop_unlock_three_args=no))
+if test "$ac_cv_func_vop_unlock_three_args" = yes; then
+ AC_DEFINE(HAVE_THREE_ARGUMENT_VOP_UNLOCK, 1,
+ [define if VOP_UNLOCK takes three arguments])
+fi
+])
Index: cf/try-compile-kernel.m4
===================================================================
RCS file: /stacken-cvs/arla/cf/try-compile-kernel.m4,v
retrieving revision 1.4
diff -u -r1.4 try-compile-kernel.m4
--- cf/try-compile-kernel.m4 12 Feb 2004 16:28:18 -0000 1.4
+++ cf/try-compile-kernel.m4 16 Feb 2008 03:49:53 -0000
@@ -8,7 +8,7 @@
 if test "X${KERNEL_CC}" != "X"; then
   CC="$KERNEL_CC"
 fi
-CFLAGS="$CFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
+CFLAGS="$CFLAGS -I/usr/include $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
 AC_TRY_COMPILE([$1], [$2], [$3], [$4])
 CFLAGS="$save_CFLAGS"
 CC="$save_CC"
Index: include/afssysdefs.h
===================================================================
RCS file: /stacken-cvs/arla/include/afssysdefs.h,v
retrieving revision 1.9
diff -u -r1.9 afssysdefs.h
--- include/afssysdefs.h 9 Aug 2004 13:42:32 -0000 1.9
+++ include/afssysdefs.h 16 Feb 2008 03:49:53 -0000
@@ -42,6 +42,7 @@
  * entry point syscalls.
  */
 
+#if defined(SunOS)
 #if SunOS == 40
 #define AFS_SYSCALL 31
 #endif
@@ -56,6 +57,7 @@
 
 #if SunOS >= 58
 #define AFS_SYSCALL 65
+#endif
 #endif
 
 #if defined(__hpux)
Index: nnpfs/bsd/nnpfs_blocks.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_blocks.c,v
retrieving revision 1.10
diff -u -r1.10 nnpfs_blocks.c
--- nnpfs/bsd/nnpfs_blocks.c 28 Mar 2007 12:05:45 -0000 1.10
+++ nnpfs/bsd/nnpfs_blocks.c 16 Feb 2008 03:49:54 -0000
@@ -306,8 +306,13 @@
       LEASE_WRITE);
     
     ret = nnpfs_block_extend_int(node, vp, p);
-    
+
+#ifdef HAVE_TWO_ARGUMENT_VOP_UNLOCK
+    VOP_UNLOCK(vp, 0);
+#endif
+#ifdef HAVE_THREE_ARGUMENT_VOP_UNLOCK
     VOP_UNLOCK(vp, 0, p);
+#endif
     vn_finished_write(mp);
  }
 #else
@@ -500,7 +505,11 @@
 #endif
 
 #ifdef __FreeBSD__
+#ifdef HAVE_FINAL_ARG_FILE_VOP_OPEN
+ error = VOP_OPEN(*vpp, fmode, cred, p, NULL);
+#else
  error = VOP_OPEN(*vpp, fmode, cred, p, -1);
+#endif
 #else
  error = VOP_OPEN(*vpp, fmode, cred, p);
 #endif
Index: nnpfs/bsd/nnpfs_common-bsd.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_common-bsd.c,v
retrieving revision 1.33
diff -u -r1.33 nnpfs_common-bsd.c
--- nnpfs/bsd/nnpfs_common-bsd.c 24 Oct 2006 16:33:02 -0000 1.33
+++ nnpfs/bsd/nnpfs_common-bsd.c 16 Feb 2008 03:49:54 -0000
@@ -72,10 +72,33 @@
 #endif /* NNPFS_DEBUG */
 
 int
-nnpfs_suser(d_thread_t *p)
+nnpfs_priv_check_debug(d_thread_t *p)
 {
 #if defined(__APPLE__)
     return proc_suser(p);
+#elif defined(HAVE_KERNEL_PRIV_CHECK)
+    return (priv_check(p, PRIV_NNPFS_DEBUG));
+#elif defined(HAVE_KERNEL_KAUTH_CRED_GETUID)
+    uid_t uid = kauth_cred_getuid(p->l_proc->p_cred);
+    if (uid == 0)
+ return 0;
+    return EPERM;
+#elif defined(HAVE_KERNEL_SUSER_UCRED)
+    return suser_ucred (nnpfs_proc_to_cred(p));
+#elif defined(HAVE_TWO_ARGUMENT_SUSER)
+    return suser (nnpfs_proc_to_cred(p), NULL);
+#else
+    return suser (p);
+#endif
+}
+
+int
+nnpfs_priv_check_fhlookup(d_thread_t *p)
+{
+#if defined(__APPLE__)
+    return proc_suser(p);
+#elif defined(HAVE_KERNEL_PRIV_CHECK)
+    return (priv_check(p, PRIV_VFS_GETFH));
 #elif defined(HAVE_KERNEL_KAUTH_CRED_GETUID)
     uid_t uid = kauth_cred_getuid(p->l_proc->p_cred);
     if (uid == 0)
Index: nnpfs/bsd/nnpfs_message.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_message.c,v
retrieving revision 1.109
diff -u -r1.109 nnpfs_message.c
--- nnpfs/bsd/nnpfs_message.c 28 Mar 2007 12:05:46 -0000 1.109
+++ nnpfs/bsd/nnpfs_message.c 16 Feb 2008 03:49:55 -0000
@@ -483,7 +483,7 @@
 
  nnpfs_block_free_all(VNODE_TO_XNODE(vp));
 
-#if HAVE_KERNEL_VGONEL
+#ifdef HAVE_KERNEL_VGONEL
  vgonel (vp, p);
 #else /* !have vgonel */
  nnpfs_interlock_unlock(&vp->v_interlock);
Index: nnpfs/bsd/nnpfs_node-bsd.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_node-bsd.c,v
retrieving revision 1.99
diff -u -r1.99 nnpfs_node-bsd.c
--- nnpfs/bsd/nnpfs_node-bsd.c 14 Mar 2007 16:44:30 -0000 1.99
+++ nnpfs/bsd/nnpfs_node-bsd.c 16 Feb 2008 03:49:55 -0000
@@ -169,6 +169,15 @@
     genfs_node_init(*vpp, &nnpfs_genfsops);
 #endif
 
+#ifdef HAVE_KERNEL_INSMNTQUE
+    error = insmntque(*vpp, NNPFS_TO_VFS(nnpfsp));
+    if (error) {
+      nnpfs_free(result, sizeof(*result), M_NNPFS_NODE);
+      *vpp = NULL;
+      return error;
+    }
+#endif
+
  retry:
     error = nnpfs_node_find(nnpfsp, handle, &check);
     if (error == ENOENT) {
@@ -756,7 +765,7 @@
  * The real change is sys/kern/vfs_cache:1.20
  */
 
-#if __NetBSD_Version__ >= 104120000 || OpenBSD > 200211
+#if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104120000) || (defined(OpenBSD) && OpenBSD > 200211)
  if (cache_lookup(dvp, &dummy, cnp) != -1) {
     nnpfs_vfs_unlock(dummy, nnpfs_cnp_to_proc(cnp));
     printf ("NNPFS PANIC WARNING! nnpfs_dnlc_enter: %s already in cache\n",
@@ -801,7 +810,7 @@
     cn->cn_nameptr = (char *)name;
     cn->cn_namelen = strlen(name);
     cn->cn_flags   = 0;
-#if __APPLE__
+#ifdef __APPLE__
     cn->cn_hash = 0; /* Let the vfs compute the hash */
 #elif defined(HAVE_KERNEL_NAMEI_HASH)
     {
Index: nnpfs/bsd/nnpfs_syscalls-common.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_syscalls-common.c,v
retrieving revision 1.85
diff -u -r1.85 nnpfs_syscalls-common.c
--- nnpfs/bsd/nnpfs_syscalls-common.c 28 Mar 2007 12:05:46 -0000 1.85
+++ nnpfs/bsd/nnpfs_syscalls-common.c 16 Feb 2008 03:49:55 -0000
@@ -484,7 +484,7 @@
  if (vice_ioctl->in_size < sizeof(int32_t))
     return EINVAL;
 
- error = nnpfs_suser(p);
+ error = nnpfs_priv_check_debug(p);
  if (error)
     return error;
 
Index: nnpfs/bsd/nnpfs_vfsops-bsd.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_vfsops-bsd.c,v
retrieving revision 1.103
diff -u -r1.103 nnpfs_vfsops-bsd.c
--- nnpfs/bsd/nnpfs_vfsops-bsd.c 27 Mar 2007 13:26:58 -0000 1.103
+++ nnpfs/bsd/nnpfs_vfsops-bsd.c 16 Feb 2008 03:49:56 -0000
@@ -84,7 +84,11 @@
 }
 
 int
+#ifdef HAVE_VFS_QUOTACTL_CADDR
 nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p)
+#else
+nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, d_thread_t *p)
+#endif
 {
     NNPFSDEB(XDEBVFOPS, ("nnpfs_quotactl: mp = %lx, cmd = %d, uid = %u, "
        "arg = %lx, proc = %lx\n",
@@ -225,6 +229,7 @@
     return 0;
 }
 
+#ifndef HAVE_VOP_VPTOFH
 int
 nnpfs_vptofh(struct vnode * vp,
      struct fid * fhp
@@ -236,6 +241,7 @@
     NNPFSDEB(XDEBVFOPS, ("nnpfs_vptofh\n"));
     return EOPNOTSUPP;
 }
+#endif
 
 #endif /* !__APPLE__ */
 
@@ -321,7 +327,7 @@
 
     NNPFSDEB(XDEBVFOPS, ("nnpfs_fhlookup (nnpfs)\n"));
 
-    error = nnpfs_suser (proc);
+    error = nnpfs_priv_check_fhlookup(proc);
     if (error)
  return EPERM;
 
@@ -484,7 +490,11 @@
  goto out;
 
 #if defined(__FreeBSD__) && __FreeBSD_version >= 502000
+#ifdef HAVE_FINAL_ARG_FILE_VOP_OPEN
+    error = VOP_OPEN(vp, flags, cred, proc, fp);
+#else
     error = VOP_OPEN(vp, flags, cred, proc, index);
+#endif
 #else
     error = VOP_OPEN(vp, flags, cred, proc);
 #endif
Index: nnpfs/bsd/nnpfs_vfsops-freebsd.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_vfsops-freebsd.c,v
retrieving revision 1.37
diff -u -r1.37 nnpfs_vfsops-freebsd.c
--- nnpfs/bsd/nnpfs_vfsops-freebsd.c 6 Mar 2007 16:00:57 -0000 1.37
+++ nnpfs/bsd/nnpfs_vfsops-freebsd.c 16 Feb 2008 03:49:56 -0000
@@ -60,7 +60,12 @@
     .vop_default = &default_vnodeops,
     .vop_lookup = nnpfs_dead_lookup,
     .vop_reclaim = nnpfs_dead_reclaim,
+#ifdef HAVE_VOP_LOCK1
+    .vop_lock1 = vop_stdlock,
+#endif
+#ifdef HAVE_VOP_LOCK
     .vop_lock = vop_stdlock,
+#endif
     .vop_unlock = vop_stdunlock,
     .vop_islocked = vop_stdislocked,
 };
@@ -76,6 +81,15 @@
     if (error == 0)
  NNPFS_MAKE_VROOT(*vpp);
 
+#ifdef HAVE_KERNEL_INSMNTQUE
+    /* XXX: Possibly should lock with lockmgr here. */
+    error = insmntque(*vpp, mp);
+    if (error) {
+      *vpp = NULL;
+      return error;
+    }
+#endif
+
     nnpfs_vfs_writelock(*vpp, nnpfs_curproc());
 
     return error;
@@ -163,7 +177,9 @@
     .vfs_vget = nnpfs_vget_freebsd,
     .vfs_fhtovp = nnpfs_fhtovp,
     .vfs_checkexp = nnpfs_checkexp,
+#ifndef HAVE_VOP_VPTOFH
     .vfs_vptofh = nnpfs_vptofh,
+#endif
     .vfs_init = nnpfs_init
 };
 /*VFS_SET(nnpfs_vfsops, arlannpfsdev, 0);*/
Index: nnpfs/bsd/nnpfs_vnodeops-bsd.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_vnodeops-bsd.c,v
retrieving revision 1.161
diff -u -r1.161 nnpfs_vnodeops-bsd.c
--- nnpfs/bsd/nnpfs_vnodeops-bsd.c 6 Mar 2007 16:00:57 -0000 1.161
+++ nnpfs/bsd/nnpfs_vnodeops-bsd.c 16 Feb 2008 03:49:57 -0000
@@ -85,7 +85,11 @@
     ret = nnpfs_open_common(ap->a_vp, ap->a_mode, ctx);
 #ifdef __FreeBSD__
     if (!ret)
+#ifdef HAVE_THREE_ARGUMENT_VNODE_CREATE_VOBJ
+ vnode_create_vobject(ap->a_vp,
+#else
  vnode_create_vobject_off(ap->a_vp,
+#endif
  nnpfs_vattr_get_size(&VNODE_TO_XNODE(ap->a_vp)->attr),
  ap->a_td);
 #endif
@@ -793,16 +797,25 @@
 #ifdef __FreeBSD__
 
 int
+#ifdef HAVE_VOP_LOCK1
+nnpfs_lock1(struct vop_lock1_args * ap)
+#else
 nnpfs_lock(struct vop_lock_args * ap)
+#endif
 {              
     struct vnode *vp = ap->a_vp;
     int ret;
 
     nnpfs_assert(vp);
+#ifdef HAVE_VOP_LOCK1
+    NNPFSDEB(XDEBVNOPS, ("nnpfs_lock1: %lx, flags 0x%x\n",
+ (unsigned long)vp, ap->a_flags));
+#else
     nnpfs_assert(ap->a_td);
     NNPFSDEB(XDEBVNOPS, ("nnpfs_lock: %lx, td %p, flags 0x%x, nlocks %d\n",
  (unsigned long)vp, NNPFS_AP_PROC(ap), ap->a_flags,
  NNPFS_AP_PROC(ap)->td_locks));
+#endif
 
     nnpfs_lk_info("nnpfs_lock before", vp);
     ret = vop_stdlock(ap);
@@ -817,16 +830,26 @@
     struct vnode *vp = ap->a_vp;
     int ret;
 
+#ifdef HAVE_TWO_ARGUMENT_VOP_UNLOCK
+    NNPFSDEB(XDEBVNOPS,
+     ("nnpfs_unlock: %lx, flags 0x%x\n", (unsigned long)vp,
+      ap->a_flags));
+#else
     NNPFSDEB(XDEBVNOPS,
      ("nnpfs_unlock: %lx, td %p, flags 0x%x, nlocks %d\n",
       (unsigned long)vp, ap->a_td, ap->a_flags,
       NNPFS_AP_PROC(ap)->td_locks));
+#endif
     
     nnpfs_lk_info("nnpfs_unlock before", vp);
     ret = vop_stdunlock(ap);
 
+#ifdef HAVE_TWO_ARGUMENT_VOP_UNLOCK
+    NNPFSDEB(XDEBVNOPS, ("nnpfs_unlock: return %d\n", ret));
+#else
     NNPFSDEB(XDEBVNOPS, ("nnpfs_unlock: return %d, td %p, nlocks %d\n",
  ret, NNPFS_AP_PROC(ap), NNPFS_AP_PROC(ap)->td_locks));
+#endif
     return ret;
 }
 
@@ -1313,6 +1336,23 @@
 }
 #endif
 
+#ifdef HAVE_VOP_VPTOFH
+int
+nnpfs_vptofh(struct vop_vptofh_args *ap)
+/*
+struct vop_vptofh_args {
+ struct vnodeop_desc *a_desc;
+ struct vnode *a_vp;
+ struct fid *a_fhp;
+};
+*/
+{
+    NNPFSDEB(XDEBVNOPS, ("nnpfs_vptofh\n"));
+
+    return EOPNOTSUPP;
+}
+#endif
+
 
 
 vop_t **nnpfs_vnodeop_p;
@@ -1466,7 +1506,12 @@
  .vop_bmap = nnpfs_bmap,
 
  .vop_poll = nnpfs_poll,
+#ifdef HAVE_VOP_LOCK1
+ .vop_lock1 = nnpfs_lock1,
+#endif
+#ifdef HAVE_VOP_LOCK
  .vop_lock = nnpfs_lock,  
+#endif
  .vop_unlock = nnpfs_unlock,
  .vop_islocked = nnpfs_islocked,
  .vop_revoke = nnpfs_revoke,
@@ -1605,6 +1650,9 @@
 #endif
 #ifdef HAVE_VOP_PATHCONF
     {&vop_pathconf_desc, (vop_t *) nnpfs_pathconf },
+#endif
+#ifdef HAVE_VOP_VPTOFH
+    {&vop_vptofh_desc, (vop_t *) nnpfs_vptofh },
 #endif
     {(struct vnodeop_desc *) NULL, (int (*) (void *)) NULL}
 };
Index: nnpfs/bsd/nnpfs_vnodeops-common.c
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs_vnodeops-common.c,v
retrieving revision 1.121
diff -u -r1.121 nnpfs_vnodeops-common.c
--- nnpfs/bsd/nnpfs_vnodeops-common.c 28 Mar 2007 12:05:46 -0000 1.121
+++ nnpfs/bsd/nnpfs_vnodeops-common.c 16 Feb 2008 03:49:57 -0000
@@ -50,7 +50,7 @@
 static void
 nnpfs_handle_stale(struct nnpfs_node *xn)
 {
-#if __APPLE__
+#ifdef __APPLE__
     struct vnode *vp = XNODE_TO_VNODE(xn);
 #endif
 
@@ -1438,7 +1438,9 @@
     int error = 0;
     nnpfs_cred cred;
     struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
+#ifdef HAVE_THREE_ARGUMENT_VOP_UNLOCK
     d_thread_t *proc = nnpfs_vfs_context_proc(ctx);
+#endif
 
     NNPFSDEB(XDEBVNOPS, ("nnpfs_readlink\n"));
 
Index: nnpfs/bsd/bin/mntopts.h
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/bin/mntopts.h,v
retrieving revision 1.7
diff -u -r1.7 mntopts.h
--- nnpfs/bsd/bin/mntopts.h 28 Dec 2005 14:32:03 -0000 1.7
+++ nnpfs/bsd/bin/mntopts.h 16 Feb 2008 03:49:58 -0000
@@ -48,7 +48,9 @@
 #define MOPT_NOACCESSTIME { "accesstime", 1, MNT_NOATIME }
 #define MOPT_NOATIME { "atime", 1, MNT_NOATIME }
 #endif
+#ifdef MOPT_NODEV
 #define MOPT_NODEV { "dev", 1, MNT_NODEV }
+#endif
 #define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC }
 #define MOPT_NOSUID { "suid", 1, MNT_NOSUID }
 #define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY }
@@ -78,6 +80,7 @@
 
 /* Standard options which all mounts can understand. */
 
+#ifdef MOPT_NODEV
 #define MOPT_STDOPTS \
  MOPT_USERQUOTA, \
  MOPT_GROUPQUOTA, \
@@ -86,5 +89,14 @@
  MOPT_NOEXEC, \
  MOPT_NOSUID, \
  MOPT_RDONLY
+#else
+#define MOPT_STDOPTS \
+ MOPT_USERQUOTA, \
+ MOPT_GROUPQUOTA, \
+ MOPT_FSTAB_COMPAT, \
+ MOPT_NOEXEC, \
+ MOPT_NOSUID, \
+ MOPT_RDONLY
+#endif
 
 void getmntopts (const char *, const struct mntopt *, int *);
Index: nnpfs/bsd/nnpfs/nnpfs_common.h
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs/nnpfs_common.h,v
retrieving revision 1.22
diff -u -r1.22 nnpfs_common.h
--- nnpfs/bsd/nnpfs/nnpfs_common.h 24 Oct 2006 16:33:14 -0000 1.22
+++ nnpfs/bsd/nnpfs/nnpfs_common.h 16 Feb 2008 03:49:58 -0000
@@ -59,7 +59,8 @@
 #define nnpfs_free(a, size,t) free(a, t)
 #endif /* NNPFS_DEBUG */
 
-int nnpfs_suser(d_thread_t *p);
+int nnpfs_priv_check_debug(d_thread_t *p);
+int nnpfs_priv_check_fhlookup(d_thread_t *p);
 
 #ifndef HAVE_KERNEL_MEMCPY
 void *
Index: nnpfs/bsd/nnpfs/nnpfs_locl.h
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs/nnpfs_locl.h,v
retrieving revision 1.113
diff -u -r1.113 nnpfs_locl.h
--- nnpfs/bsd/nnpfs/nnpfs_locl.h 6 Mar 2007 16:01:56 -0000 1.113
+++ nnpfs/bsd/nnpfs/nnpfs_locl.h 16 Feb 2008 03:49:58 -0000
@@ -121,6 +121,9 @@
 #ifdef HAVE_SYS_KAUTH_H
 #include <sys/kauth.h>
 #endif
+#ifdef HAVE_SYS_PRIV_H
+#include <sys/priv.h>
+#endif
 
 #ifdef HAVE_MISCFS_GENFS_GENFS_H
 #include <miscfs/genfs/genfs.h>
@@ -296,7 +299,7 @@
 struct genfs_ops nnpfs_genfsops;
 #endif
 
-#if __NetBSD_Version__ >= 399001900 /* NetBSD 3.99.19 */
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 399001900 /* NetBSD 3.99.19 */
 typedef struct kauth_cred *nnpfs_kernel_cred;
 #define nnpfs_cred_get_uid(cred) kauth_cred_getuid(cred)
 #else
Index: nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h,v
retrieving revision 1.25
diff -u -r1.25 nnpfs_vfsops-bsd.h
--- nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h 6 Mar 2007 16:01:56 -0000 1.25
+++ nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h 16 Feb 2008 03:49:58 -0000
@@ -79,7 +79,11 @@
 nnpfs_root(struct mount *mp, struct vnode **vpp);
 
 int
+#ifdef HAVE_VFS_QUOTACTL_CADDR
 nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p);
+#else
+nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, d_thread_t *p);
+#endif
 
 int
 nnpfs_statfs(struct mount *mp, nnpfs_statvfs *sbp, d_thread_t *p);
@@ -114,6 +118,7 @@
      struct ucred ** credanonp);
 #endif
 
+#ifndef HAVE_VOP_VPTOFH
 int
 nnpfs_vptofh(struct vnode * vp,
      struct fid * fhp
@@ -121,6 +126,7 @@
      ,size_t * fidsz
 #endif
      );
+#endif
 
 int
 nnpfs_dead_lookup(struct vop_lookup_args *ap);
Index: nnpfs/freebsd/FreeBSD-Makefile
===================================================================
RCS file: /stacken-cvs/arla/nnpfs/freebsd/FreeBSD-Makefile,v
retrieving revision 1.7
diff -u -r1.7 FreeBSD-Makefile
--- nnpfs/freebsd/FreeBSD-Makefile 6 Mar 2007 12:54:00 -0000 1.7
+++ nnpfs/freebsd/FreeBSD-Makefile 16 Feb 2008 03:49:58 -0000
@@ -29,6 +29,7 @@
 bsdsrcdir= $(srcdir)/../bsd
 
 CFLAGS= -g \
+ -I/usr/include \
  -I${.CURDIR} \
  -I${.CURDIR}/../../include \
  -I${.CURDIR}/../include \
@@ -45,6 +46,6 @@
 .PATH: $(bsdsrcdir)
 
 nnpfs_vopdefs.h: vnode_if.h
- awk '/^struct vop_[a-z]*_args/ { vop=substr($$2,5,length($$2)-9); printf("#define HAVE_VOP_%s 1\n", toupper(vop)); printf("NNPFS_VOP_DEF(%s);\n", vop); }' vnode_if.h > ${.TARGET}
+ awk '/^struct vop_[a-z0-9]*_args/ { vop=substr($$2,5,length($$2)-9); printf("#define HAVE_VOP_%s 1\n", toupper(vop)); printf("NNPFS_VOP_DEF(%s);\n", vop); }' vnode_if.h > ${.TARGET}
  -mkdir nnpfs
  test -d nnpfs && ( test -f nnpfs/nnpfs_vopdefs.h || ln -s ../nnpfs_vopdefs.h nnpfs/nnpfs_vopdefs.h )


_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Rasmus Kaj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...>

_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@rwatson_cinnamon_coda on 2008/02/18 01:04:20

  New build fix for NetBSDism in Arla.

Affected files ...

.. //depot/user/rwatson/arla/porting/nnpfs/bsd/nnpfs/nnpfs_locl.h#4 edit

Differences ...

==== //depot/user/rwatson/arla/porting/nnpfs/bsd/nnpfs/nnpfs_locl.h#4 (text+ko) ====

@@ -118,7 +118,7 @@
  #ifdef HAVE_SYS_ATTR_H
  #include <sys/attr.h>
  #endif
-#if __NetBSD_Version__ >= 399001900 /* 3.99.19 */
+#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 399001900 /* 3.99.19 */
  #define HAVE_SYS_KAUTH_H
  #endif
  #ifdef HAVE_SYS_KAUTH_H
_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Alec Kloss-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
Xint0x80_syscall() at Xint0x80_syscall+0x20
--- syscall (188, FreeBSD ELF32, stat), eip = 0x281a3acb, esp = 0xbfbfe54c, ebp = 0xbfbfe5d8 ---
db>

If I'me reading this (and nnpfs_vnodeops_common.c) right, this is
probably a NULL value for (xn or perhaps vap) in

        *vap = xn->attr;

(line 765) Any thoughts?  Or tips on what I can do to help?  I
don't have gdb ready to go yet---but I probably can this weekend.  

--
Alec Kloss  alec@...   IM: angryspamhater@...
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo


attachment0 (194 bytes) Download Attachment

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

by Alec Kloss-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
0x26c(%eax),%eax
db> bt
Tracing pid 5754 tid 100206 td 0xc298e220
nnpfs_inactive_common(c2a58440,c298e220,cd49bb54,c0a68485,cd49bb6c,...)
at nnpfs_inactive_common+0xc
nnpfs_inactive(cd49bb6c,c2a584c8,c2a58440,c2a584c8,cd49bb84,...) at
nnpfs_inactive+0x1e
VOP_INACTIVE_APV(c2a2b4a0,cd49bb6c,c0afa47c,8fd,c0bd93e0,...) at
VOP_INACTIVE_APV+0xa5
vinactive(c2a584c8,0,c0afa47c,86d,c253b880,...) at vinactive+0x91
vrele(c2a58440,c2a2ba70,0,c2a2800b,0,...) at vrele+0x18b
nnpfs_free_all_nodes(c2a2b6e0,0,1,c2a58330,c2a2b6e0,...) at
nnpfs_free_all_nodes+0xa5
nnpfs_unmount_common(c231329c,8000000,0,c298e220,cd49bc54,...) at
nnpfs_unmount_common+0x4e
nnpfs_unmount(c231329c,8000000,c298e220,4f0,4da,...) at
nnpfs_unmount+0x49
dounmount(c231329c,8000000,c298e220,482,8,...) at dounmount+0x426
unmount(c298e220,cd49bcfc,8,3d90d,c0ba0ed0,...) at unmount+0x2e0
syscall(cd49bd38) at syscall+0x2b3
Xint0x80_syscall() at Xint0x80_syscall+0x20
--- syscall (22, FreeBSD ELF32, unmount), eip = 0x280c62db, esp =
0xbfbfe4dc, ebp = 0xbfbfe598 ---
db>

--
Alec Kloss  alec@...   IM: angryspamhater@...
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo


attachment0 (194 bytes) Download Attachment

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

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
> 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
> Xint0x80_syscall() at Xint0x80_syscall+0x20
> --- syscall (188, FreeBSD ELF32, stat), eip = 0x281a3acb, esp = 0xbfbfe54c, ebp = 0xbfbfe5d8 ---
> db>
>
> If I'me reading this (and nnpfs_vnodeops_common.c) right, this is
> probably a NULL value for (xn or perhaps vap) in
>
>        *vap = xn->attr;
>
> (line 765) Any thoughts?  Or tips on what I can do to help?  I
> don't have gdb ready to go yet---but I probably can this weekend.
>
> --
> Alec Kloss  alec@...   IM: angryspamhater@...
> PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
> "No Bunny!" -- Simon, from Frisky Dingo
>
_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Alec Kloss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...   IM: angryspamhater@...
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo


attachment0 (194 bytes) Download Attachment

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

by Alec Kloss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...:/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) @ /usr/src/sys/kern/vfs_mount.c:1242
 2nd 0xc2dabaf8 syncer (syncer) @ /usr/src/sys/kern/vfs_subr.c:2156
KDB: stack backtrace:
db_trace_self_wrapper(c0af1b78,cd4b3b2c,c07a1a6e,c0af3fc2,c2dabaf8,...) at db_trace_self_wrapper+0x26
kdb_backtrace(c0af3fc2,c2dabaf8,c0afad01,c0afad01,c0afa47c,...) at kdb_backtrace+0x29
witness_checkorder(c2dabaf8,9,c0afa47c,86c,c0c16cb4,...) at witness_checkorder+0x6de
_lockmgr(c2dabaf8,2002,c2dabb28,c0afa47c,86c,...) at _lockmgr+0x43c
vop_stdlock(cd4b3bc4,c0afa47c,c07a1338,2002,c2dabaa0,...) at vop_stdlock+0x39
VOP_LOCK1_APV(c0bb0980,cd4b3bc4,84f,cd4b3be4,c2dabb28,...) at VOP_LOCK1_APV+0xa5
_vn_lock(c2dabaa0,2002,c0afa47c,86c,0,...) at _vn_lock+0xf2
vrele(c2dabaa0,0,c0af9de1,4f0,4da,...) at vrele+0x142
dounmount(c231329c,8000000,c356b000,482,8,...) at dounmount+0x372
unmount(c356b000,cd4b3cfc,8,cd4b3d38,c0ba0ed0,...) at unmount+0x2e0
syscall(cd4b3d38) at syscall+0x2b3
Xint0x80_syscall() at Xint0x80_syscall+0x20
--- syscall (22, FreeBSD ELF32, unmount), eip = 0x280c62db, esp =
0xbfbfe4ec, ebp = 0xbfbfe5a8 ---

I see a few other lock order reversals on -CURRENT right now
anyway, so I'm not sure if it's cause for concern or even caused
by arla.

I'm going to move on to trying everything on 7.x.  I know there are
autoconf/etc. things that need to be fixed.  Do you want me to work
on that or are you likely to have it done already.  
I do have a tweaked version of your patch---as I recall it contains
just one typo fix---at

        http://setfilepointer.com/pub/arla/20080218-arla.diff

There's also the snapshot of the sources I used:

        http://setfilepointer.com/pub/arla/arla-20080118.tar.bz2

Assuming I get things working on 7.x, I'll update the port I built
later today.  :)

--
Alec Kloss  alec@...   IM: angryspamhater@...
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo


attachment0 (194 bytes) Download Attachment

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

by Alec Kloss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry for the chatter... arla makes me excited.  :)

I've gotten Robert's patches compiled and running under -CURRENT,
RELENG_7, and RELENG_6.  A FreeBSD port and FreeBSD packages are
available at

        http://setfilepointer.com/pub/afs/FreeBSD/

All of the heavy lifting is done in the big patch at

        http://setfilepointer.com/pub/arla/20080223-arla.diff

This was generated by taking a current snapshot from arla's CVS,
applying Robert's original patch, and then adding a handful of
fixes of my own.  The jist of my changes are autoconf corrections,
and one test for NNPFS_DEBUG_PRIV which is undefined on -CURRENT.
There's a general autoconf problem running around that a few tests
require -Werror to work correctly some can't have -Werror to work
correctly.  

I've run the "-all -fast" tests which don't cause any major issues
on RELENG_7 and -CURRENT, but I do seem to be able to panic 6.x
with those tests.  More testers and feedback would be appreciated.

Can anyone from Arla comment on the chances for incorporating
these patches into Arla itself?  It'd be nice to have these changes
in Arla itself prior to submitting the port to FreeBSD.

And, can anyone comment on need for the arla port to include 0.43,
which works on FreeBSD 5.x?

Robert, thanks so much for your time.  I owe you (at least) a beer.  

--
Alec Kloss  alec@...   IM: angryspamhater@...
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo


attachment0 (194 bytes) Download Attachment

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

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 23 Feb 2008, Alec Kloss wrote:

> All of the heavy lifting is done in the big patch at
>
> http://setfilepointer.com/pub/arla/20080223-arla.diff
>
> This was generated by taking a current snapshot from arla's CVS, applying
> Robert's original patch, and then adding a handful of fixes of my own.  The
> jist of my changes are autoconf corrections, and one test for
> NNPFS_DEBUG_PRIV which is undefined on -CURRENT. There's a general autoconf
> problem running around that a few tests require -Werror to work correctly
> some can't have -Werror to work correctly.

Sounds great, although PRIV_NNPFS_DEBUG should be defined on the most recent
-CURRENT; I added it last week, so if you're running a slightly older
-CURRENT, that could be why.  I believe I also MFC'd to RELENG_7 but it won't
make FreeBSD 7.0.

> I've run the "-all -fast" tests which don't cause any major issues on
> RELENG_7 and -CURRENT, but I do seem to be able to panic 6.x with those
> tests.  More testers and feedback would be appreciated.
>
> Can anyone from Arla comment on the chances for incorporating these patches
> into Arla itself?  It'd be nice to have these changes in Arla itself prior
> to submitting the port to FreeBSD.
>
> And, can anyone comment on need for the arla port to include 0.43, which
> works on FreeBSD 5.x?
>
> Robert, thanks so much for your time.  I owe you (at least) a beer.

No problem at all -- this is something I've been meaning to do for years, and
I'm very pleased all the pieces are coming together :-).

Robert N M Watson
Computer Laboratory
University of Cambridge
_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Tomas Olsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2008-02-23 at 10:12 -0600, Alec Kloss wrote:
> All of the heavy lifting is done in the big patch at
>
> http://setfilepointer.com/pub/arla/20080223-arla.diff
[...]
> Can anyone from Arla comment on the chances for incorporating
> these patches into Arla itself?  It'd be nice to have these changes
> in Arla itself prior to submitting the port to FreeBSD.
>
Chances are good. If it looks ok it goes in.

> Robert, thanks so much for your time.  I owe you (at least) a beer.  
Methinks you're worth one too.

Thanks for the great work!

/t

_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Tomas Olsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wrote:

> On Sat, 2008-02-23 at 10:12 -0600, Alec Kloss wrote:
> > All of the heavy lifting is done in the big patch at
> >
> > http://setfilepointer.com/pub/arla/20080223-arla.diff
> [...]
> > Can anyone from Arla comment on the chances for incorporating
> > these patches into Arla itself?  It'd be nice to have these changes
> > in Arla itself prior to submitting the port to FreeBSD.
> >
> Chances are good. If it looks ok it goes in.
>
Looks mostly ok, but I do have some questions.

1) appl/fs/fs_local.h: would that break `fs nnpfsdeb all`?

2) cf/try-compile-kernel.m4: why do we need /usr/include? It sounds
scary given that we may want to compile using random kernel trees. Same
goes for nnpfs/freebsd/FreeBSD-Makefile. I don't know much about kernel
build magic.

3) cf/bsd-vop-unlock.m4: do we need it? I don't care about older
versions of FreeBSD than 6.x; traditionally we try to support latest
stable OS-release plus -CURRENT but maybe that's a bit limiting.
Perphaps nnpfs_vfs_unlock solves part of the problem?

thanks
       /t

_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."


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

by Palle Girgensohn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm delighted to see all this chatter about arla. Any chance we can get a
server working as well? I reckon that should, in principle, be easier,
since it is not as much kernel involvement, right? But the best bet is
OpenAFS, and it is different animal, so the KTH guys are not as deep into
this code?

/Palle <girgen@...>

And hi, Rasmus! :-)


_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."


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

by Alec Kloss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2008-02-25 00:22, Palle Girgensohn wrote:

> I'm delighted to see all this chatter about arla. Any chance we can get a
> server working as well? I reckon that should, in principle, be easier,
> since it is not as much kernel involvement, right? But the best bet is
> OpenAFS, and it is different animal, so the KTH guys are not as deep into
> this code?
>
> /Palle <girgen@...>
>
> And hi, Rasmus! :-)
>
>
Oh, the OpenAFS server has worked on FreeBSD forever, and I run two
cells with multiple terabytes of data on FreeBSD only.  The OpenAFS
param files tend to be out of date but I'm planning on getting
on top of that too.  There's a port of OpenAFS 1.5.30 I put together
available right next to the arla stuff here:

http://setfilepointer.com/pub/afs/FreeBSD/

I tend to install the server everywhere I install arla because the
vos and bos commands in arla in incomplete compared to their
implementation in openafs.  I suppose I should nag someone at
OpenAFS to include the new param files I made for newer FreeBSDs
(not that the new param files are particularly inspired).  It'd be
great if a few people would comment on this port and then I guess
I'll create a PR to get it included in the ports tree at the same
time as arla.

Sound good?

Also, who's writing the FreeBSD wiki?  I'm embarrased to tell
people to go look at the gentoo documentation for AFS.  :)

--
Alec Kloss  alec@...   IM: angryspamhater@...
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo


attachment0 (194 bytes) Download Attachment

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

by Hugo Meiland-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>
> Also, who's writing the FreeBSD wiki?  I'm embarrased to tell
> people to go look at the gentoo documentation for AFS.  :)
>
>  

I tried to create afs pages on the wiki twice; but was denied each
time.... any change of opening an account to get me writing??

Hugo

_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, 25 Feb 2008, Hugo Meiland wrote:

>> Also, who's writing the FreeBSD wiki?  I'm embarrased to tell people to go
>> look at the gentoo documentation for AFS.  :)
>
> I tried to create afs pages on the wiki twice; but was denied each time....
> any change of opening an account to get me writing??

Getting you set up shouldn't be a problem at all -- could you e-mail me your
wiki.FreeBSD.org username and I'll add you to ContributorsGroup.

Robert N M Watson
Computer Laboratory
University of Cambridge
_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Tomas Olsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 2008-02-24 at 18:17 -0600, Alec Kloss wrote:
> I tend to install the server everywhere I install arla because the
> vos and bos commands in arla in incomplete compared to their
> implementation in openafs.
Of course, one solution would be to nag and/or code until they get good
enough in arla... Getting another vos subcommand or two to work
shouldn't be all that much work. And we all love to complete skeleton
patches, don't we :)

/t



_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 24 Feb 2008, Tomas Olsson wrote:

> I wrote:
>> On Sat, 2008-02-23 at 10:12 -0600, Alec Kloss wrote:
>>> All of the heavy lifting is done in the big patch at
>>>
>>> http://setfilepointer.com/pub/arla/20080223-arla.diff
>> [...]
>>> Can anyone from Arla comment on the chances for incorporating these
>>> patches into Arla itself?  It'd be nice to have these changes in Arla
>>> itself prior to submitting the port to FreeBSD.
>>>
>> Chances are good. If it looks ok it goes in.
>>
> Looks mostly ok, but I do have some questions.
>
> 1) appl/fs/fs_local.h: would that break `fs nnpfsdeb all`?
>
> 2) cf/try-compile-kernel.m4: why do we need /usr/include? It sounds scary
> given that we may want to compile using random kernel trees. Same goes for
> nnpfs/freebsd/FreeBSD-Makefile. I don't know much about kernel build magic.
>
> 3) cf/bsd-vop-unlock.m4: do we need it? I don't care about older versions of
> FreeBSD than 6.x; traditionally we try to support latest stable OS-release
> plus -CURRENT but maybe that's a bit limiting. Perphaps nnpfs_vfs_unlock
> solves part of the problem?

Just back from FOSDEM, and am 3-4 days behind on e-mail, so will need to
investigate (1) and (2) in a day or two.

If I've done (1) correctly then, in practice, it shouldn't change things at
all, except that on FreeBSD 7.x and higher, it will use the priv(9) interface
to check for privilege rather than suser(9).  While there are plans for
further privilege semantic changes, the interface change so far is actually a
syntactic change -- the policy remains the same, but information about the
check is managed differently, hence the change to the interface.  This is a
precursor to more fine-grained privileges in the kernel.

With respect to (2), I need to look at the details, but I believe this has to
do with the fact that nnpfs is relying on generated files that may not be
present in a kernel source tree.  The more right fix may be to force
generation of the files (if we can) in the nnpfs build, as we already do for
vnode_if.h, but I'll have to look in more detail.

With respect to (3) -- that has to do with support for 8-CURRENT, not pre-6.x.
It looks like the VFS folks are in the middle of dropping unnecessary thread
arguments from various locking interfaces in VFS, including
lock/unlock/assert/etc (these will now all be curthread implicitly).  I just
saw a couple more such changes trickle in today, so I'll probably have some
more patches, sadly.

Robert N M Watson
Computer Laboratory
University of Cambridge
_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."

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

by Alec Kloss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First off, I've got a few hours to work on this tomorrow night, so
if we could decide on an approach (and Robert can help me with the
heavy lifting) before then, that'd be super.  

On 2008-02-25 21:19, Robert Watson wrote:

> On Sun, 24 Feb 2008, Tomas Olsson wrote:
>
> >Looks mostly ok, but I do have some questions.
> >
> >1) appl/fs/fs_local.h: would that break `fs nnpfsdeb all`?
> >
> >2) cf/try-compile-kernel.m4: why do we need /usr/include? It sounds scary
> >given that we may want to compile using random kernel trees. Same goes for
> >nnpfs/freebsd/FreeBSD-Makefile. I don't know much about kernel build magic.
> >
> >3) cf/bsd-vop-unlock.m4: do we need it? I don't care about older versions
> >of FreeBSD than 6.x; traditionally we try to support latest stable
> >OS-release plus -CURRENT but maybe that's a bit limiting. Perphaps
> >nnpfs_vfs_unlock solves part of the problem?
>
> Just back from FOSDEM, and am 3-4 days behind on e-mail, so will need to
> investigate (1) and (2) in a day or two.
>
> If I've done (1) correctly then, in practice, it shouldn't change things at
> all, except that on FreeBSD 7.x and higher, it will use the priv(9)
> interface to check for privilege rather than suser(9).  While there are
> plans for further privilege semantic changes, the interface change so far
> is actually a syntactic change -- the policy remains the same, but
> information about the check is managed differently, hence the change to the
> interface.  This is a precursor to more fine-grained privileges in the
> kernel.
I can shed a little light.  It's definitely broken now as fs
nnpfsdeb almost-all has no effect.  I added the check for
PRIV_NNPFS_DEBUG in nnpfs_common-bsd.c:

+#elif defined(HAVE_KERNEL_PRIV_CHECK) && defined(PRIV_NNPFS_DEBUG)

because on my -current box PRIV_NNPFS_DEBUG isn't defined.  I
thought it might be an OpenBSD-ism.  Regardless, I would think it
*should* fall back to checking with suser() but apparently it
doesn't.  I can investigate a bit more, but removing nnpfs_deb.h
must have broader impact than we though.  Robert, any thoughts
about what PRIV_NNPFS_DEBUG should be?

> With respect to (2), I need to look at the details, but I believe this has
> to do with the fact that nnpfs is relying on generated files that may not
> be present in a kernel source tree.  The more right fix may be to force
> generation of the files (if we can) in the nnpfs build, as we already do
> for vnode_if.h, but I'll have to look in more detail.

I think this is correct too.  Things like machine/endian.h aren't
in the kernel tree.  I should be able to autoconf this for just
FreeBSD if that's how we want to approach this.  If you want
to have configure generate these headers like vnode_if.h, I'll
probably need a few hints, but I'll do what I can.

> With respect to (3) -- that has to do with support for 8-CURRENT, not
> pre-6.x. It looks like the VFS folks are in the middle of dropping
> unnecessary thread arguments from various locking interfaces in VFS,
> including lock/unlock/assert/etc (these will now all be curthread
> implicitly).  I just saw a couple more such changes trickle in today, so
> I'll probably have some more patches, sadly.

And I added the cf check... I found HAVE_THREE_ARGUMENT_VOP_UNLOCK
was undefined in ./nnpfs/bsd/nnpfs_vnodeops-common.c and figured
it's smarter to just add the check than assume something about
VOP_UNLOCK from the VOP_LOCK macros.  

--
Alec Kloss  alec@...   IM: angryspamhater@...
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo


attachment0 (194 bytes) Download Attachment

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

by Robert Watson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, 25 Feb 2008, Alec Kloss wrote:

> I can shed a little light.  It's definitely broken now as fs nnpfsdeb
> almost-all has no effect.  I added the check for PRIV_NNPFS_DEBUG in
> nnpfs_common-bsd.c:
>
> +#elif defined(HAVE_KERNEL_PRIV_CHECK) && defined(PRIV_NNPFS_DEBUG)
>
> because on my -current box PRIV_NNPFS_DEBUG isn't defined.  I thought it
> might be an OpenBSD-ism.  Regardless, I would think it *should* fall back to
> checking with suser() but apparently it doesn't.  I can investigate a bit
> more, but removing nnpfs_deb.h must have broader impact than we though.
> Robert, any thoughts about what PRIV_NNPFS_DEBUG should be?

PRIV_NNPFS_DEBUG is a definition that will appear in FreeBSD 7.1, but 7.0 was
already in final freeze when I added it to 8.x + 7.x.  The reason I didn't
have a specific check for PRIV_NNPFS_DEBUG is that I adapted nnpfs for 8.x,
but not 7.0.  If priv(9) is present but not PRIV_NNPFS_DEBUG, we should use
PRIV_ROOT for now.

>> With respect to (2), I need to look at the details, but I believe this has
>> to do with the fact that nnpfs is relying on generated files that may not
>> be present in a kernel source tree.  The more right fix may be to force
>> generation of the files (if we can) in the nnpfs build, as we already do
>> for vnode_if.h, but I'll have to look in more detail.
>
> I think this is correct too.  Things like machine/endian.h aren't in the
> kernel tree.  I should be able to autoconf this for just FreeBSD if that's
> how we want to approach this.  If you want to have configure generate these
> headers like vnode_if.h, I'll probably need a few hints, but I'll do what I
> can.

Indeed, it was machine/endian.h that did it.

Robert N M Watson
Computer Laboratory
University of Cambridge
_______________________________________________
freebsd-afs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-afs
To unsubscribe, send any mail to "freebsd-afs-unsubscribe@..."
< Prev | 1 - 2 - 3 | Next >