Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
f8a41a75
Commit
f8a41a75
authored
Jan 04, 2018
by
Mike Hibler
Browse files
The new -I option was missing from the patch.
parent
ee72b56b
Changes
1
Hide whitespace changes
Inline
Side-by-side
patches/FreeBSD-10.3-mountd.patch
View file @
f8a41a75
...
...
@@ -147,18 +147,42 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
struct exportlist *exphead;
struct mountlist *mlhead;
@@ -241,6 +288,1
0
@@
@@ -241,6 +288,1
1
@@
int dolog = 0;
int got_sighup = 0;
int xcreated = 0;
+#ifdef SPLIT_MOUNT
+int forceincremental = 0;
+int got_sigusr1 = 0;
+char *tsfile = "/var/run/mountd.ts";
+#endif
char *svcport_str = NULL;
static int mallocd_svcport = 0;
@@ -467,7 +518,7 @@
@@ -380,7 +432,7 @@
else
close(s);
- while ((c = getopt(argc, argv, "2deh:lnop:rS")) != -1)
+ while ((c = getopt(argc, argv, "2deh:lnop:rSI")) != -1)
switch (c) {
case '2':
force_v2 = 1;
@@ -435,6 +487,13 @@
case 'S':
suspend_nfsd = 1;
break;
+#ifdef SPLIT_MOUNT
+ case 'I':
+ forceincremental = 1;
+ break;
+#else
+ usage();
+#endif
default:
usage();
};
@@ -467,7 +526,7 @@
openlog("mountd", LOG_PID, LOG_DAEMON);
if (debug)
warnx("getting export list");
...
...
@@ -167,7 +191,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (debug)
warnx("getting mount list");
get_mountlist();
@@ -479,6 +53
0
,9 @@
@@ -479,6 +53
8
,9 @@
signal(SIGQUIT, SIG_IGN);
}
signal(SIGHUP, huphandler);
...
...
@@ -177,12 +201,16 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
signal(SIGTERM, terminate);
signal(SIGPIPE, SIG_IGN);
@@ -638,9 +
692
,1
5
@@
@@ -638,9 +
700
,1
9
@@
/* Expand svc_run() here so that we can call get_exportlist(). */
for (;;) {
if (got_sighup) {
- get_exportlist();
+#ifdef SPLIT_MOUNT
+ get_exportlist(forceincremental);
+#else
+ get_exportlist(0);
+#endif
got_sighup = 0;
}
+#ifdef SPLIT_MOUNT
...
...
@@ -194,7 +222,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
readfds = svc_fdset;
switch (select(svc_maxfd + 1, &readfds, NULL, NULL, NULL)) {
case -1:
@@ -1020,6 +10
80
,9 @@
@@ -1020,6 +10
92
,9 @@
sigemptyset(&sighup_mask);
sigaddset(&sighup_mask, SIGHUP);
...
...
@@ -204,7 +232,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
saddr = svc_getrpccaller(transp)->buf;
switch (saddr->sa_family) {
case AF_INET6:
@@ -1296,6 +13
59
,9 @@
@@ -1296,6 +13
71
,9 @@
sigemptyset(&sighup_mask);
sigaddset(&sighup_mask, SIGHUP);
...
...
@@ -214,7 +242,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
sigprocmask(SIG_BLOCK, &sighup_mask, NULL);
ep = exphead;
while (ep) {
@@ -1404,11 +14
70
,152 @@
@@ -1404,11 +14
82
,152 @@
int linesize;
FILE *exp_file;
...
...
@@ -368,7 +396,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
{
struct exportlist *ep, *ep2;
struct grouplist *grp, *tgrp;
@@ -1421,9 +16
28
,11 @@
@@ -1421,9 +16
40
,11 @@
v4root_phase = 0;
dirhead = (struct dirlist *)NULL;
...
...
@@ -380,7 +408,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
cp = line;
nextfield(&cp, &endcp);
if (*cp == '#')
@@ -1463,6 +16
72
,7 @@
@@ -1463,6 +16
84
,7 @@
len = endcp-cp;
tgrp = grp = get_grp();
while (len > 0) {
...
...
@@ -388,7 +416,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (len > MNTNAMLEN) {
getexp_err(ep, tgrp);
goto nextline;
@@ -1475,8 +16
85
,14 @@
@@ -1475,8 +16
97
,14 @@
if (debug)
warnx("doing opt %s", cp);
got_nondir = 1;
...
...
@@ -405,7 +433,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
getexp_err(ep, tgrp);
goto nextline;
}
@@ -1534,7 +17
50
,12 @@
@@ -1534,7 +17
62
,12 @@
* See if this directory is already
* in the list.
*/
...
...
@@ -418,7 +446,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (ep == (struct exportlist *)NULL) {
ep = get_exp();
ep->ex_fs = fsb.f_fsid;
@@ -1576,6 +1
797
,7 @@
@@ -1576,6 +1
809
,7 @@
goto nextline;
}
...
...
@@ -426,7 +454,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
/*
* Get the host or netgroup.
*/
@@ -1604,6 +18
26
,10 @@
@@ -1604,6 +18
38
,10 @@
} while (netgrp && getnetgrent(&hst, &usr, &dom));
endnetgrent();
*endcp = savedc;
...
...
@@ -437,7 +465,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
}
cp = endcp;
nextfield(&cp, &endcp);
@@ -1654,11 +18
80
,17 @@
@@ -1654,11 +18
92
,17 @@
*/
grp = tgrp;
do {
...
...
@@ -457,7 +485,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
} while (grp->gr_next && (grp = grp->gr_next));
/*
@@ -1682,6 +19
14
,7 @@
@@ -1682,6 +19
26
,7 @@
/*
* Success. Update the data structures.
*/
...
...
@@ -465,7 +493,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (has_host) {
hang_dirp(dirhead, tgrp, ep, opt_flags);
grp->gr_next = grphead;
@@ -1689,13 +19
22
,22 @@
@@ -1689,13 +19
34
,22 @@
} else {
hang_dirp(dirhead, (struct grouplist *)NULL, ep,
opt_flags);
...
...
@@ -488,7 +516,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
/*
* Insert in the list in alphabetical order.
*/
@@ -1706,8 +19
48
,15 @@
@@ -1706,8 +19
60
,15 @@
if (ep2)
ep->ex_next = ep2;
*epp = ep;
...
...
@@ -504,7 +532,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
nextline:
v4root_phase = 0;
if (dirhead) {
@@ -1715,75 +196
4
,63 @@
@@ -1715,75 +19
7
6,63 @@
dirhead = (struct dirlist *)NULL;
}
}
...
...
@@ -617,7 +645,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (num > 0) {
build_iovec(&iov, &iovlen, "fstype", NULL, 0);
@@ -1795,7 +20
32
,10 @@
@@ -1795,7 +20
44
,10 @@
}
for (i = 0; i < num; i++) {
...
...
@@ -629,7 +657,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) {
syslog(LOG_ERR, "getvfsbyname() failed for %s",
fsp->f_fstypename);
@@ -1834,6 +20
74
,7 @@
@@ -1834,6 +20
86
,7 @@
"can't delete exports for %s: %m %s",
fsp->f_mntonname, errmsg);
}
...
...
@@ -637,7 +665,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
}
if (iov != NULL) {
@@ -1848,7 +2
089
,32
5
@@
@@ -1848,7 +2
101
,32
6
@@
/* free iov, allocated by realloc() */
free(iov);
iovlen = 0;
...
...
@@ -916,6 +944,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
+ }
+#endif
+
+ syslog(LOG_INFO, "Doing %s update\n", incremental ? "incremental" : "full");
+ TS_GET(tsexport);
+ if (!incremental && suspend_nfsd != 0) {
+ TS_GET(suspend);
...
...
@@ -963,7 +992,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
/*
* Read in the exports file and build the list, calling
@@ -1862,7 +24
21
,7 @@
@@ -1862,7 +24
34
,7 @@
syslog(LOG_WARNING, "can't open %s", exnames[i]);
continue;
}
...
...
@@ -972,7 +1001,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
fclose(exp_file);
done++;
}
@@ -1871,6 +243
0
,28 @@
@@ -1871,6 +24
4
3,28 @@
exit(2);
}
...
...
@@ -1001,7 +1030,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
/*
* If there was no public fh, clear any previous one set.
*/
@@ -1879,6 +24
60
,87 @@
@@ -1879,6 +24
73
,87 @@
/* Resume the nfsd. If they weren't suspended, this is harmless. */
(void)nfssvc(NFSSVC_RESUMENFSD, NULL);
...
...
@@ -1089,7 +1118,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
}
/*
@@ -1954,6 +26
16
,8 @@
@@ -1954,6 +26
29
,8 @@
{
struct dirlist *dp;
...
...
@@ -1098,7 +1127,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len);
if (dp == (struct dirlist *)NULL)
out_of_mem();
@@ -2376,7 +30
40
,7 @@
@@ -2376,7 +30
53
,7 @@
ai->ai_flags |= AI_CANONNAME;
}
if (debug)
...
...
@@ -1107,7 +1136,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
/*
* Sanity check: make sure we don't already have an entry
* for this host in the grouplist.
@@ -2467,7 +31
31
,8 @@
@@ -2467,7 +31
44
,8 @@
*/
int
do_mount(struct exportlist *ep, struct grouplist *grp, int exflags,
...
...
@@ -1117,7 +1146,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
{
struct statfs fsb1;
struct addrinfo *ai;
@@ -2481,6 +31
46
,8 @@
@@ -2481,6 +31
59
,8 @@
int ret;
struct nfsex_args nfsea;
...
...
@@ -1126,7 +1155,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (run_v4server > 0)
eap = &nfsea.export;
else
@@ -2586,7 +32
53
,34 @@
@@ -2586,7 +32
66
,34 @@
iov[5].iov_len = strlen(fsb->f_mntfromname) + 1;
errmsg[0] = '\0';
...
...
@@ -1162,7 +1191,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
if (cp)
*cp-- = savedc;
else
@@ -2692,6 +33
86
,12 @@
@@ -2692,6 +33
99
,12 @@
/* free iov, allocated by realloc() */
free(iov);
}
...
...
@@ -1175,7 +1204,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
return (ret);
}
@@ -2906,6 +36
06
,15 @@
@@ -2906,6 +36
19
,15 @@
struct group *gr;
gid_t groups[XU_NGROUPS + 1];
int ngroups;
...
...
@@ -1191,7 +1220,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
cr->cr_version = XUCRED_VERSION;
/*
@@ -2932,17 +364
1
,44 @@
@@ -2932,17 +36
5
4,44 @@
syslog(LOG_ERR, "unknown user: %s", name);
return;
}
...
...
@@ -1240,7 +1269,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
return;
}
/*
@@ -3150,6 +38
86
,7 @@
@@ -3150,6 +38
99
,7 @@
/*
* Check an absolute directory path for any symbolic links. Return true
...
...
@@ -1248,7 +1277,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
*/
int
check_dirpath(char *dirp)
@@ -3168,7 +39
05
,7 @@
@@ -3168,7 +39
18
,7 @@
}
cp++;
}
...
...
@@ -1257,7 +1286,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
ret = 0;
return (ret);
}
@@ -3292,9 +402
9
,14 @@
@@ -3292,9 +40
4
2,14 @@
}
void
...
...
@@ -1274,7 +1303,7 @@ diff -Nu mountd.orig/mountd.c mountd/mountd.c
}
void terminate(int sig __unused)
@@ -3304,4 +40
46
,3 @@
@@ -3304,4 +40
59
,3 @@
rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL);
exit (0);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment