From b3a2ec1e4446b48f099785426f756618d19cef15 Mon Sep 17 00:00:00 2001 From: "Robert V. Baron" Date: Mon, 16 Nov 1998 19:48:26 +0000 Subject: [PATCH] A few bug fixes for Robert Watson --- sys/coda/coda_vfsops.c | 14 ++++++++++++-- sys/coda/coda_vnops.c | 15 ++++++++++++--- sys/fs/coda/coda_vfsops.c | 14 ++++++++++++-- sys/fs/coda/coda_vnops.c | 15 ++++++++++++--- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/sys/coda/coda_vfsops.c b/sys/coda/coda_vfsops.c index 42006c03ffde..e282911706f1 100644 --- a/sys/coda/coda_vfsops.c +++ b/sys/coda/coda_vfsops.c @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: coda_vfsops.c,v 1.7 1998/09/29 20:19:45 rvb Exp $ + * $Id: coda_vfsops.c,v 1.8 1998/11/03 08:55:06 peter Exp $ * */ @@ -47,6 +47,15 @@ /* * HISTORY * $Log: coda_vfsops.c,v $ + * Revision 1.8 1998/11/03 08:55:06 peter + * Support KLD. We register and unregister two modules. "coda" (the vfs) + * via VFS_SET(), and "codadev" for the cdevsw entry. From kldstat -v: + * 3 1 0xf02c5000 115d8 coda.ko + * Contains modules: + * Id Name + * 2 codadev + * 3 coda + * * Revision 1.7 1998/09/29 20:19:45 rvb * Fixes for lkm: * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL @@ -427,6 +436,7 @@ coda_unmount(vfsp, mntflags, p) vrele(mi->mi_rootvp); active = coda_kill(vfsp, NOT_DOWNCALL); + mi->mi_rootvp->v_flag &= ~VROOT; error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE); printf("coda_unmount: active = %d, vflush active %d\n", active, error); error = 0; @@ -506,7 +516,7 @@ coda_root(vfsp, vpp) MARK_INT_SAT(CODA_ROOT_STATS); goto exit; - } else if (error == ENODEV) { + } else if (error == ENODEV || error == EINTR) { /* Gross hack here! */ /* * If Venus fails to respond to the CODA_ROOT call, coda_call returns diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c index bcf713d6dd12..624796e61ae5 100644 --- a/sys/coda/coda_vnops.c +++ b/sys/coda/coda_vnops.c @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: coda_vnops.c,v 1.7 1998/10/25 17:44:41 phk Exp $ + * $Id: coda_vnops.c,v 1.8 1998/10/28 20:31:13 rvb Exp $ * */ @@ -48,6 +48,13 @@ /* * HISTORY * $Log: coda_vnops.c,v $ + * Revision 1.8 1998/10/28 20:31:13 rvb + * Change the way unmounting happens to guarantee that the + * client programs are allowed to finish up (coda_call is + * forced to complete) and release their locks. Thus there + * is a reasonable chance that the vflush implicit in the + * unmount will not get hung on held locks. + * * Revision 1.7 1998/10/25 17:44:41 phk * Nitpicking and dusting performed on a train. Removes trivial warnings * about unused variables, labels and other lint. @@ -369,10 +376,12 @@ int coda_vop_error(void *anon) { struct vnodeop_desc **desc = (struct vnodeop_desc **)anon; - myprintf(("Vnode operation %s called, but not defined\n", + myprintf(("coda_vop_error: Vnode operation %s called, but not defined.\n", (*desc)->vdesc_name)); + /* panic("coda_vop_error"); - return 0; + */ + return EIO; } /* A generic do-nothing. For lease_check, advlock */ diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 42006c03ffde..e282911706f1 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: coda_vfsops.c,v 1.7 1998/09/29 20:19:45 rvb Exp $ + * $Id: coda_vfsops.c,v 1.8 1998/11/03 08:55:06 peter Exp $ * */ @@ -47,6 +47,15 @@ /* * HISTORY * $Log: coda_vfsops.c,v $ + * Revision 1.8 1998/11/03 08:55:06 peter + * Support KLD. We register and unregister two modules. "coda" (the vfs) + * via VFS_SET(), and "codadev" for the cdevsw entry. From kldstat -v: + * 3 1 0xf02c5000 115d8 coda.ko + * Contains modules: + * Id Name + * 2 codadev + * 3 coda + * * Revision 1.7 1998/09/29 20:19:45 rvb * Fixes for lkm: * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL @@ -427,6 +436,7 @@ coda_unmount(vfsp, mntflags, p) vrele(mi->mi_rootvp); active = coda_kill(vfsp, NOT_DOWNCALL); + mi->mi_rootvp->v_flag &= ~VROOT; error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE); printf("coda_unmount: active = %d, vflush active %d\n", active, error); error = 0; @@ -506,7 +516,7 @@ coda_root(vfsp, vpp) MARK_INT_SAT(CODA_ROOT_STATS); goto exit; - } else if (error == ENODEV) { + } else if (error == ENODEV || error == EINTR) { /* Gross hack here! */ /* * If Venus fails to respond to the CODA_ROOT call, coda_call returns diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index bcf713d6dd12..624796e61ae5 100644 --- a/sys/fs/coda/coda_vnops.c +++ b/sys/fs/coda/coda_vnops.c @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: coda_vnops.c,v 1.7 1998/10/25 17:44:41 phk Exp $ + * $Id: coda_vnops.c,v 1.8 1998/10/28 20:31:13 rvb Exp $ * */ @@ -48,6 +48,13 @@ /* * HISTORY * $Log: coda_vnops.c,v $ + * Revision 1.8 1998/10/28 20:31:13 rvb + * Change the way unmounting happens to guarantee that the + * client programs are allowed to finish up (coda_call is + * forced to complete) and release their locks. Thus there + * is a reasonable chance that the vflush implicit in the + * unmount will not get hung on held locks. + * * Revision 1.7 1998/10/25 17:44:41 phk * Nitpicking and dusting performed on a train. Removes trivial warnings * about unused variables, labels and other lint. @@ -369,10 +376,12 @@ int coda_vop_error(void *anon) { struct vnodeop_desc **desc = (struct vnodeop_desc **)anon; - myprintf(("Vnode operation %s called, but not defined\n", + myprintf(("coda_vop_error: Vnode operation %s called, but not defined.\n", (*desc)->vdesc_name)); + /* panic("coda_vop_error"); - return 0; + */ + return EIO; } /* A generic do-nothing. For lease_check, advlock */