ref: 863a459691f1a75ee687174df76e78dffa58f4f2
parent: 972f60a794bb58d9c99014dc28ec88e7883cea5d
author: cinap_lenrek <[email protected]>
date: Wed Jun 4 13:45:08 EDT 2014
webfs: explicitely unmount old /mnt/web (thanks BurnZeZ) webfs forks the namespace to isolate itself from its mount point which has the side effect that it captures the mount of previous instances of webfs mounted on /mnt/web. explicitely unmount the mountpoint in our namespace copy to drop the reference.
--- a/sys/src/cmd/webfs/fs.c
+++ b/sys/src/cmd/webfs/fs.c
@@ -76,6 +76,8 @@
nil,
};
+static char *mtpt;
+static char *service;
static long time0;
static char *user;
static char *agent;
@@ -741,8 +743,17 @@
}
}
+static void
+fsstart(Srv*)
+{
+ /* drop reference to old webfs mount */
+ if(mtpt != nil)
+ unmount(nil, mtpt);
+}
+
Srv fs =
{
+ .start=fsstart,
.attach=fsattach,
.stat=fsstat,
.walk1=fswalk1,
@@ -757,7 +768,7 @@
void
usage(void)
{
- fprint(2, "usage: %s [-D] [-A useragent] [-T timeout] [-m mtpt] [-s srv]\n", argv0);
+ fprint(2, "usage: %s [-D] [-A useragent] [-T timeout] [-m mtpt] [-s service]\n", argv0);
exits("usage");
}
@@ -764,7 +775,7 @@
void
main(int argc, char *argv[])
{
- char *srv, *mtpt, *s;
+ char *s;
quotefmtinstall();
fmtinstall('U', Ufmt);
@@ -771,12 +782,10 @@
fmtinstall('H', Hfmt);
fmtinstall('E', Efmt);
- srv = nil;
mtpt = "/mnt/web";
user = getuser();
time0 = time(0);
timeout = 10000;
- agent = nil;
ARGBEGIN {
case 'D':
@@ -794,7 +803,7 @@
mtpt = EARGF(usage());
break;
case 's':
- srv = EARGF(usage());
+ service = EARGF(usage());
break;
case 'd':
debug++;
@@ -814,6 +823,6 @@
free(s);
}
- postmountsrv(&fs, srv, mtpt, MREPL);
+ postmountsrv(&fs, service, mtpt, MREPL);
exits(0);
}