summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-08-31 21:51:01 +0000
committertrasz <trasz@FreeBSD.org>2014-08-31 21:51:01 +0000
commit2ded039a6da22e85917388ed0b611e4858d05a72 (patch)
treeabf99ae68023542be3b688570626d72fde248cca /sys/fs
parent87f90af6e4825d0640770331d4a17eb12fa2625b (diff)
downloadFreeBSD-src-2ded039a6da22e85917388ed0b611e4858d05a72.zip
FreeBSD-src-2ded039a6da22e85917388ed0b611e4858d05a72.tar.gz
MFC r270399:
Add comment explaining one of the quirks in autofs. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/autofs/autofs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/fs/autofs/autofs.c b/sys/fs/autofs/autofs.c
index d3ea03d..d5a6892 100644
--- a/sys/fs/autofs/autofs.c
+++ b/sys/fs/autofs/autofs.c
@@ -595,6 +595,14 @@ autofs_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
sx_xlock(&sc->sc_lock);
+ /*
+ * We must never block automountd(8) and its descendants, and we use
+ * session ID to determine that: we store session id of the process
+ * that opened the device, and then compare it with session ids
+ * of triggering processes. This means running a second automountd(8)
+ * instance would break the previous one. The check below prevents
+ * it from happening.
+ */
if (sc->sc_dev_opened) {
sx_xunlock(&sc->sc_lock);
return (EBUSY);
OpenPOWER on IntegriCloud