Commit 4ddc74c2 authored by Mike Hibler's avatar Mike Hibler

Changes to support non-racy NFS exports.

As of FreeBSD 9, the race condition in mountd has been addressed.
We automatically (based on the OS running) add the option to mountd (-S)
as part of ops-install. There is also a configuration variable, NFSRACY,
that we auto-detect and set in elabinelab setup. For regular installs,
you need to set this manually in the defs-* file. Note that the setting
in the defs file does not affect very much. It is passed to the client-side
which uses it in one copy function (used as a fall back for getting the
topology file).

There are still a couple of places in the Emulab code where handling
the race condition is hardwired into the code (most notably, imagezip).
These remain.
parent 83bf052f
......@@ -178,6 +178,9 @@ my $SINGLE_CONTROLNET = 0;
# Support a shared filesystem between fs server and nodes
my $SHAREDFS = 1;
# When there is a shared FS via NFS, does it have the mountd race?
my $NFSRACY = 1;
# Start up the frisbee master server to act as an IGMP querier
# so that frisbee works (if there is no other querier running).
# -1 means let the system decide.
......@@ -242,6 +245,7 @@ my %emulabconfig = (
"CONFIG_USERDB" => !$NOCOLLAB,
"CONFIG_WIKI" => !$NOCOLLAB,
"CONFIG_SHAREDFS" => $SHAREDFS,
"CONFIG_NFSRACY" => $NFSRACY,
"CONFIG_QUERIER" => $NEEDQUERIER,
"CONFIG_OPSVM" => $OPSVM,
"CONFIG_NODBINIT" => 0,
......@@ -393,6 +397,10 @@ sub doboot()
$emulabconfig{"MFSVERSION"} = "62";
}
if ($FBSD_VERSION >= 9.2) {
$emulabconfig{"CONFIG_NFSRACY"} = 0;
}
# Determine if a XEN VM.
if (system("sysctl -n kern.vm_guest >/dev/null 2>&1") == 0) {
my $vm_guest = `sysctl -n kern.vm_guest`;
......@@ -3282,6 +3290,14 @@ sub CreateDefsFile($)
}
last SWITCH;
};
/^NFSRACY$/ && do {
if ($emulabconfig{"CONFIG_NFSRACY"}) {
print OUTDEFS "NFSRACY=1\n";
} else {
print OUTDEFS "NFSRACY=0\n";
}
last SWITCH;
};
/^SELFLOADER_DATA$/ && do {
#
# Use the SelfLoader in perl 5.8 or beyond (though note
......
......@@ -42,6 +42,7 @@ OPSDBSUPPORT=changeme
WINSUPPORT=0
NSVERIFY=changeme
NOSHAREDFS=changeme
NFSRACY=changeme
SFSSUPPORT=0
CVSSUPPORT=changeme
NFSTRACESUPPORT=0
......
......@@ -21,9 +21,15 @@ sub Install($$$)
qq|mountd_enable="YES"|,
qq|nfs_server_enable="YES"|,
qq|nfs_server_flags="-u -t -n 16"|,
qq|mountd_flags="-r -p 900"|,
qq|syslogd_flags=""|);
# No more NFS races as of 9.2!
if ($FBSD_MAJOR > 9 || ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1)) {
push(@adds, qq|mountd_flags="-r -p 900 -S"|);
} else {
push(@adds, qq|mountd_flags="-r -p 900"|);
}
if (ISFS($server)) {
if ($WINSUPPORT) {
if ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment