From owner-freebsd-bugs Thu Oct 18 11: 0:22 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6B82537B431 for ; Thu, 18 Oct 2001 11:00:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9II02s47377; Thu, 18 Oct 2001 11:00:02 -0700 (PDT) (envelope-from gnats) Received: from infres.enst.fr (infres-192.enst.fr [137.194.192.1]) by hub.freebsd.org (Postfix) with ESMTP id 8F72C37B407 for ; Thu, 18 Oct 2001 10:53:23 -0700 (PDT) Received: from shalmaneser.enst.fr (shalmaneser.enst.fr [137.194.162.11]) by infres.enst.fr (Postfix) with ESMTP id BB1FF18A6 for ; Thu, 18 Oct 2001 19:53:16 +0200 (MEST) Received: by shalmaneser.enst.fr (Postfix, from userid 11117) id EB35D112F4; Thu, 18 Oct 2001 19:53:14 +0200 (CEST) Message-Id: <20011018175314.EB35D112F4@shalmaneser.enst.fr> Date: Thu, 18 Oct 2001 19:53:14 +0200 (CEST) From: Thomas Quinot Reply-To: Thomas Quinot To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: conf/31358: Need to load NFS client LKM. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31358 >Category: conf >Synopsis: Need to load NFS client LKM. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 18 11:00:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Thomas Quinot >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD shalmaneser.enst.fr 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Wed Oct 17 19:16:27 CEST 2001 quinot@shalmaneser.enst.fr:/usr/obj/usr/src/sys/SHALMANESER i386 >Description: When nfs_client_enable is YES and NFS client code is compiled as an LKM, the LKM must be kldloaded before NFS client sysctls are performed in rc.network. Furthermore, when AMD is enabled, nfs_client needs to be enabled too, as a dependency. >How-To-Repeat: >Fix: The following patch: * adds a dependency that enables NFS client if AMD is enabled; * uses a sysctl -r to check whether the NFS client code is compiled into the kernel, and attempts to kldload nfsclient if it is not. --- /usr/src/etc/rc Wed Oct 10 14:54:51 2001 +++ rc Thu Oct 18 19:31:22 2001 @@ -103,6 +103,7 @@ } chkdepend amd amd_enable portmap portmap_enable +chkdepend amd amd_enable NFS nfs_client_enable chkdepend NFS nfs_server_enable portmap portmap_enable chkdepend NIS nis_server_enable portmap portmap_enable chkdepend NIS nis_client_enable portmap portmap_enable --- /usr/src/etc/rc.network Thu Oct 11 12:56:02 2001 +++ rc.network Thu Oct 18 19:38:32 2001 @@ -657,8 +657,25 @@ ;; esac + if sysctl -r vfs.nfs.access_cache_timeout > /dev/null 2>&1; then + nfsclient_in_kernel=1 + else + nfsclient_in_kernel=0 + fi + case ${nfs_client_enable} in [Yy][Ee][Ss]) + if [ "${nfsclient_in_kernel}" -eq 0 ] && kldload nfsclient; then + nfsclient_in_kernel=1 + echo 'NFS client kernel module loaded' + elif [ "${nfsclient_in_kernel}" -eq 0 ]; then + echo 'Warning: NFS client kernel module failed to load' + fi + ;; + esac + + case "${nfsclient_in_kernel}" in + 1) if [ -n "${nfs_access_cache}" ]; then echo -n " NFS access cache time=${nfs_access_cache}" sysctl -w vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null @@ -666,6 +683,27 @@ if [ -n "${nfs_bufpackets}" ]; then sysctl -w vfs.nfs.bufpackets=${nfs_bufpackets} > /dev/null fi + + case ${amd_enable} in + [Yy][Ee][Ss]) + echo -n ' amd' + case ${amd_map_program} in + [Nn][Oo] | '') + ;; + *) + amd_flags="${amd_flags} `eval\ + ${amd_map_program}`" + ;; + esac + + if [ -n "${amd_flags}" ]; then + amd -p ${amd_flags}\ + > /var/run/amd.pid 2> /dev/null + else + amd 2> /dev/null + fi + ;; + esac ;; esac @@ -675,27 +713,6 @@ if [ -f /var/db/mounttab ]; then rpc.umntall -k fi - - case ${amd_enable} in - [Yy][Ee][Ss]) - echo -n ' amd' - case ${amd_map_program} in - [Nn][Oo] | '') - ;; - *) - amd_flags="${amd_flags} `eval\ - ${amd_map_program}`" - ;; - esac - - if [ -n "${amd_flags}" ]; then - amd -p ${amd_flags}\ - > /var/run/amd.pid 2> /dev/null - else - amd 2> /dev/null - fi - ;; - esac ;; esac >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message