summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-12-05 22:53:17 +0000
committerrwatson <rwatson@FreeBSD.org>2004-12-05 22:53:17 +0000
commit6b017b90b94979aab1277bc08906afb0f00fc227 (patch)
tree09652a336e7f20e815728affc1df4e3ae2db3e70 /sys/nfsclient
parent22be685755fbf4d2f31ae2643b3a0b689f7b67d4 (diff)
downloadFreeBSD-src-6b017b90b94979aab1277bc08906afb0f00fc227.zip
FreeBSD-src-6b017b90b94979aab1277bc08906afb0f00fc227.tar.gz
Convert GIANT_REQUIRED; in nfs_mountroot() to NET_ASSERT_GIANT(),
and annotate that nfs_mountroot assumes it is OK to step on the values in the global NFSv3 diskless structure as the mountroot function is called during a serialized part of the boot, before any other NFS client activity occurs. MFC after: 2 weeks
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vfsops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 3e6c370..801335b 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -378,6 +378,11 @@ nfsmout:
* - If nfs_diskless.mygateway is filled in, use that address as
* a default gateway.
* - build the rootfs mount point and call mountnfs() to do the rest.
+ *
+ * It is assumed to be safe to read, modify, and write the nfsv3_diskless
+ * structure, as well as other global NFS client variables here, as
+ * nfs_mountroot() will be called once in the boot before any other NFS
+ * client activity occurs.
*/
int
nfs_mountroot(struct mount *mp, struct thread *td)
@@ -389,7 +394,7 @@ nfs_mountroot(struct mount *mp, struct thread *td)
u_long l;
char buf[128];
- GIANT_REQUIRED; /* XXX until socket locking done */
+ NET_ASSERT_GIANT();
#if defined(BOOTP_NFSROOT) && defined(BOOTP)
bootpc_init(); /* use bootp to get nfs_diskless filled in */
OpenPOWER on IntegriCloud