Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Oct 2001 19:53:14 +0200 (CEST)
From:      Thomas Quinot <quinot@inf.enst.fr>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   conf/31358: Need to load NFS client LKM.
Message-ID:  <20011018175314.EB35D112F4@shalmaneser.enst.fr>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011018175314.EB35D112F4>