Arla 0.22 on FreeBSD 4.0-CURRENT

Love lha at stacken.kth.se
Fri Feb 26 02:30:42 CET 1999


Robert Watson <robert at cyrus.watson.org> writes:

> What is the appropriate way to unmount Arla? :-)  I tried:
> 
> 1) kill arlad
> 2) umount_xfs /afs

3) kldunload -v -n xfs.kp

> And it appears to have deadlocked:
> % ps awxl | grep arla
>     0   271     1   4 -14  0  7840 3636 vgone  DEs   ??    0:00.00
> (arlad)

Try the patch below. Dont forget to run autoreconf before reruning
configure.

This works for freebsd 4.0-current, guess it will work for 3.1 too.

Love


Index: xfs/bsd/xfs/xfs_fs.h
===================================================================
RCS file: /usr/local/cvsroot/arla/xfs/bsd/xfs/xfs_fs.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -r1.13 -r1.14
--- xfs_fs.h	1998/12/22 13:16:19	1.13
+++ xfs_fs.h	1999/02/26 00:44:54	1.14
@@ -79,7 +79,7 @@
 int new_xfs_node(struct xfs *, struct xfs_msg_node *, struct xfs_node **,
 		 struct proc *);
 void free_xfs_node(struct xfs_node *);
-int free_all_xfs_nodes(struct xfs *, int);
+int free_all_xfs_nodes(struct xfs *, int, int);
 
 int xfs_dnlc_enter(struct vnode *, xfs_componentname *, struct vnode *);
 int xfs_dnlc_enter_name(struct vnode *, const char *, struct vnode *);
Index: xfs/bsd/xfs_vfsops-common.c
===================================================================
RCS file: /usr/local/cvsroot/arla/xfs/bsd/xfs_vfsops-common.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- xfs_vfsops-common.c	1999/02/01 00:10:02	1.16
+++ xfs_vfsops-common.c	1999/02/26 00:46:02	1.17
@@ -226,7 +226,7 @@
 	flags |= FORCECLOSE;
     }
 
-    error = free_all_xfs_nodes(xfsp, flags);
+    error = free_all_xfs_nodes(xfsp, flags, 1);
     if (error)
 	return error;
 
Index: xfs/bsd/xfs_node-osf.c
===================================================================
RCS file: /usr/local/cvsroot/arla/xfs/bsd/xfs_node-osf.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- xfs_node-osf.c	1998/12/22 13:16:14	1.8
+++ xfs_node-osf.c	1999/02/26 00:46:45	1.9
@@ -143,7 +143,7 @@
 }
 
 int
-free_all_xfs_nodes(struct xfs *xfsp, int flags)
+free_all_xfs_nodes(struct xfs *xfsp, int flags, int unmountp)
 {
     int error = 0;
     struct mount *mp = XFS_TO_VFS(xfsp);
Index: xfs/bsd/xfs_node-bsd.c
===================================================================
RCS file: /usr/local/cvsroot/arla/xfs/bsd/xfs_node-bsd.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -w -r1.23 -r1.24
--- xfs_node-bsd.c	1999/01/03 08:29:24	1.23
+++ xfs_node-bsd.c	1999/02/26 00:47:48	1.24
@@ -166,7 +166,7 @@
 }
 
 int
-free_all_xfs_nodes(struct xfs *xfsp, int flags)
+free_all_xfs_nodes(struct xfs *xfsp, int flags, int unmountp)
 {
     int error = 0;
     struct mount *mp = XFS_TO_VFS(xfsp);
@@ -180,9 +180,9 @@
 
     xfs_dnlc_purge_mp(mp);
 
+    if (xfsp->root) {
     XFSDEB(XDEBNODE, ("free_all_xfs_nodes now removing root\n"));
 
-    if (xfsp->root) {
 	vgone(XNODE_TO_VNODE(xfsp->root));
 	xfsp->root = 0;
     }
@@ -190,7 +190,15 @@
     XFSDEB(XDEBNODE, ("free_all_xfs_nodes root removed\n"));
     XFSDEB(XDEBNODE, ("free_all_xfs_nodes now killing all remaining nodes\n"));
 
+#ifdef HAVE_STRUCT_MOUNT_MNT_SYNCER
+    if (!unmountp) {
+	XFSDEB(XDEBNODE, ("free_all_xfs_nodes not flushing syncer vnode\n"));
+	error = vflush(mp, mp->mnt_syncer, flags);
+    } else
+#endif
+    {
     error = vflush(mp, NULL, flags);
+    }
 
     if (error) {
 	XFSDEB(XDEBNODE, ("xfree_all_xfs_nodes: vflush() error == %d\n",
Index: xfs/bsd/xfs_dev-common.c
===================================================================
RCS file: /usr/local/cvsroot/arla/xfs/bsd/xfs_dev-common.c,v
retrieving revision 1.18.2.1
retrieving revision 1.20
diff -u -w -r1.18.2.1 -r1.20
--- xfs_dev-common.c	1999/02/22 14:07:20	1.18.2.1
+++ xfs_dev-common.c	1999/02/26 00:48:53	1.20
@@ -181,8 +181,7 @@
 	    XFSDEB(XDEBNODE, ("xfs_dev_close: vfs_busy() --> BUSY\n"));
 	    return EBUSY;
 	}
-
-	free_all_xfs_nodes(&xfs[minor(dev)], FORCECLOSE);
+	free_all_xfs_nodes(&xfs[minor(dev)], FORCECLOSE, 0);
 
 	xfs_vfs_unbusy(xfs[minor(dev)].mp, proc);
     }
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/arla/configure.in,v
retrieving revision 1.248.2.2
retrieving revision 1.251
diff -u -w -r1.248.2.2 -r1.251
--- configure.in	1999/02/22 14:14:43	1.248.2.2
+++ configure.in	1999/02/26 00:51:57	1.251
@@ -1069,6 +1069,28 @@
 #ifdef HAVE_SYS_PROC_H
 #include <sys/proc.h>
 #endif
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+],
+mount,
+struct vnode *,
+mnt_syncer)
+
+
+AC_HAVE_KERNEL_STRUCT_FIELD([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_PROC_H
+#include <sys/proc.h>
+#endif
 ],
 proc,
 register_t *,
Index: acconfig.h
===================================================================
RCS file: /usr/local/cvsroot/arla/acconfig.h,v
retrieving revision 1.71.2.2
retrieving revision 1.74
diff -u -w -r1.71.2.2 -r1.74
--- acconfig.h	1999/02/22 14:14:59	1.71.2.2
+++ acconfig.h	1999/02/26 00:52:24	1.74
@@ -334,14 +334,17 @@
 /* Define this is you have a vfssw */
 #undef HAVE_VFSSW
 
+/* Define this if struct mount have mnt_syncer */
+#undef HAVE_STRUCT_MOUNT_MNT_SYNCER
+
 /* Define this if struct proc have p_sigmask */
 #undef HAVE_STRUCT_PROC_P_SIGMASK
 
-/* Define this if struct proc have p_retval */
-#undef HAVE_STRUCT_PROC_P_RETVAL
-
 /* Define this if you have struct a_flags instead of a_waitfor in vop_fseek*/
 #undef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS
+
+/* Define this if struct proc have p_retval */
+#undef HAVE_STRUCT_PROC_P_RETVAL
 
 /* Define this if struct file_operations has flush */
 #undef HAVE_STRUCT_FILE_OPERATIONS_FLUSH





More information about the Arla-drinkers mailing list