summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_default.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2001-02-18 02:22:58 +0000
committerbde <bde@FreeBSD.org>2001-02-18 02:22:58 +0000
commitf50b2608fdd0c95d9a95c2e591fdecd2ec282181 (patch)
treeb463c3ed8e1e54c93458a9d5260ec2e1f01c1743 /sys/kern/vfs_default.c
parent29bd08f30d5c68740a2b19e48a34846bc7bace84 (diff)
downloadFreeBSD-src-f50b2608fdd0c95d9a95c2e591fdecd2ec282181.zip
FreeBSD-src-f50b2608fdd0c95d9a95c2e591fdecd2ec282181.tar.gz
Added a dummy lookup vop. Specfs was broken by removing its dummy
lookup vop so that it defaulted to using vop_eopnotsupp for strange lookups like the ones for open("/dev/null/", ...) and stat("/dev/null/", ...). This mainly caused the wrong errno to be returned by vfs syscalls (EOPNOTSUPP is not in POSIX, and is not documented in connection with specfs in open.2 and is not documented in stat.2 at all). Also, lookup vops are apparently required to set *ap->a_vpp to NULL on error, but vop_eopnotsupp is too broken to do this.
Diffstat (limited to 'sys/kern/vfs_default.c')
-rw-r--r--sys/kern/vfs_default.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index 618ce56..3e9fc75 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -65,7 +65,8 @@
#include <vm/vnode_pager.h>
#include <vm/vm_zone.h>
-static int vop_nostrategy __P((struct vop_strategy_args *));
+static int vop_nolookup __P((struct vop_lookup_args *));
+static int vop_nostrategy __P((struct vop_strategy_args *));
/*
* This vnode table stores what we want to do if the filesystem doesn't
@@ -90,6 +91,7 @@ static struct vnodeopv_entry_desc default_vnodeop_entries[] = {
{ &vop_islocked_desc, (vop_t *) vop_noislocked },
{ &vop_lease_desc, (vop_t *) vop_null },
{ &vop_lock_desc, (vop_t *) vop_nolock },
+ { &vop_lookup_desc, (vop_t *) vop_nolookup },
{ &vop_open_desc, (vop_t *) vop_null },
{ &vop_pathconf_desc, (vop_t *) vop_einval },
{ &vop_poll_desc, (vop_t *) vop_nopoll },
@@ -154,9 +156,20 @@ int
vop_panic(struct vop_generic_args *ap)
{
- printf("vop_panic[%s]\n", ap->a_desc->vdesc_name);
- panic("Filesystem goof");
- return (0);
+ panic("filesystem goof: vop_panic[%s]", ap->a_desc->vdesc_name);
+}
+
+static int
+vop_nolookup(ap)
+ struct vop_lookup_args /* {
+ struct vnode *a_dvp;
+ struct vnode **a_vpp;
+ struct componentname *a_cnp;
+ } */ *ap;
+{
+
+ *ap->a_vpp = NULL;
+ return (ENOTDIR);
}
/*
OpenPOWER on IntegriCloud