From owner-freebsd-bugs Sun Dec 12 20:50: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 0FB3514ECC for ; Sun, 12 Dec 1999 20:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA76816; Sun, 12 Dec 1999 20:50:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from mulet.e.kth.se (mulet.e.kth.se [130.237.43.20]) by hub.freebsd.org (Postfix) with ESMTP id 736F914EE7 for ; Sun, 12 Dec 1999 20:45:27 -0800 (PST) (envelope-from root@mulet.e.kth.se) Received: (from root@localhost) by mulet.e.kth.se (8.9.3/8.9.3) id FAA01587; Mon, 13 Dec 1999 05:46:19 +0100 (CET) (envelope-from root) Message-Id: <199912130446.FAA01587@mulet.e.kth.se> Date: Mon, 13 Dec 1999 05:46:19 +0100 (CET) From: assar@stacken.kth.se To: FreeBSD-gnats-submit@freebsd.org Cc: assar@stacken.kth.se, culverk@culverk.student.umd.edu X-Send-Pr-Version: 3.2 Subject: kern/15452: getfh syscall is only installed with NFS Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 15452 >Category: kern >Synopsis: getfh syscall is only installed with NFS >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 12 20:50:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Assar Westerlund >Release: FreeBSD 4.0-CURRENT i386 >Organization: none >Environment: -current >Description: The function for the getfh system call is in kern/vfs_syscalls.c and is always compiled it (and rather small), but the system call is only added to the table (`sysent') in the NFS code. This doesn't make sense, why not always have the system call? The other file handle system calls (fhopen et al) are always included but they're kind of non-useful with getfh. >How-To-Repeat: build a kernel with NFS_NOSERVER or without NFS. call getfh(). >Fix: --- kern/syscalls.master.orig Mon Nov 22 12:42:21 1999 +++ kern/syscalls.master Mon Dec 13 05:37:08 1999 @@ -248,7 +248,7 @@ 159 UNIMPL NOHIDE nosys 160 UNIMPL NOHIDE nosys ; 161 is initialized by the NFS code, if present. -161 NOIMPL BSD { int getfh(char *fname, struct fhandle *fhp); } +161 STD BSD { int getfh(char *fname, struct fhandle *fhp); } 162 STD BSD { int getdomainname(char *domainname, int len); } 163 STD BSD { int setdomainname(char *domainname, int len); } 164 STD BSD { int uname(struct utsname *name); } --- nfs/nfs_subs.c.orig Mon Dec 13 05:38:28 1999 +++ nfs/nfs_subs.c Mon Dec 13 05:39:00 1999 @@ -117,8 +117,6 @@ #ifndef NFS_NOSERVER static vop_t *nfs_prev_vop_lease_check; -static int nfs_prev_getfh_sy_narg; -static sy_call_t *nfs_prev_getfh_sy_call; /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. @@ -558,8 +556,6 @@ extern struct nfsnodehashhead *nfsnodehashtbl; extern u_long nfsnodehash; -struct getfh_args; -extern int getfh(struct proc *, struct getfh_args *, int *); struct nfssvc_args; extern int nfssvc(struct proc *, struct nfssvc_args *, int *); @@ -1184,12 +1180,6 @@ sysent[SYS_nfssvc].sy_narg = 2; nfs_prev_nfssvc_sy_call = sysent[SYS_nfssvc].sy_call; sysent[SYS_nfssvc].sy_call = (sy_call_t *)nfssvc; -#ifndef NFS_NOSERVER - nfs_prev_getfh_sy_narg = sysent[SYS_getfh].sy_narg; - sysent[SYS_getfh].sy_narg = 2; - nfs_prev_getfh_sy_call = sysent[SYS_getfh].sy_call; - sysent[SYS_getfh].sy_call = (sy_call_t *)getfh; -#endif nfs_pbuf_freecnt = nswbuf / 2 + 1; @@ -1209,10 +1199,6 @@ lease_updatetime = nfs_prev_lease_updatetime; sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg; sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call; -#ifndef NFS_NOSERVER - sysent[SYS_getfh].sy_narg = nfs_prev_getfh_sy_narg; - sysent[SYS_getfh].sy_call = nfs_prev_getfh_sy_call; -#endif return (0); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message