Page MenuHomeFreeBSD

D40961.diff
No OneTemporary

D40961.diff

diff --git a/usr.sbin/autofs/automount.c b/usr.sbin/autofs/automount.c
--- a/usr.sbin/autofs/automount.c
+++ b/usr.sbin/autofs/automount.c
@@ -260,6 +260,7 @@
flush_caches(void)
{
struct statfs *mntbuf;
+ struct statfs statbuf;
int i, nitems;
nitems = getmntinfo(&mntbuf, MNT_WAIT);
@@ -274,6 +275,21 @@
mntbuf[i].f_mntonname);
continue;
}
+ /*
+ * A direct map mountpoint may have been mounted over, in
+ * which case we can't MNT_UPDATE it. There's an obvious race
+ * condition remaining here, but that has to be fixed in the
+ * kernel.
+ */
+ if (statfs(mntbuf[i].f_mntonname, &statbuf) != 0) {
+ log_err(1, "cannot statfs %s", mntbuf[i].f_mntonname);
+ continue;
+ }
+ if (strcmp(statbuf.f_fstypename, "autofs") != 0) {
+ log_debugx("skipping %s, filesystem type is not autofs",
+ mntbuf[i].f_mntonname);
+ continue;
+ }
flush_autofs(mntbuf[i].f_mntonname);
}

File Metadata

Mime Type
text/plain
Expires
Fri, May 2, 4:51 PM (17 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17908303
Default Alt Text
D40961.diff (928 B)

Event Timeline