Commit Graph

21 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
c12582546e Implement autofs_print(), for improved debugging experience.
MFC after:	1 month
2016-08-11 14:27:23 +00:00
Edward Tomasz Napierala
905807264d Remove write-only variable.
MFC after:	1 month
2016-07-29 12:15:55 +00:00
Edward Tomasz Napierala
e635011374 Silence down the "insmntque() failed" autofs error; it happens
on shutdown and is perfectly normal.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-17 12:04:39 +00:00
Edward Tomasz Napierala
42ed64e39b Speed up lookups in autofs(5) by using red-black trees instead of linear
searches.

Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5627
2016-03-24 13:34:39 +00:00
Edward Tomasz Napierala
f8eecb9709 Pacify Coverity in a better way, to avoid write-only variable when building
without INVARIANTS.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-16 14:00:45 +00:00
Edward Tomasz Napierala
ee4256cf01 Pacify Coverity.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-15 20:42:36 +00:00
Edward Tomasz Napierala
49d8ebfe0e Remove name length limitation from autofs(5). The linear search with
strlens is somewhat suboptimal, but it's a temporary measure that will
be replaced with red-black trees later on.

PR:		204417
Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5266
2016-03-13 14:17:23 +00:00
Edward Tomasz Napierala
7571d31339 Use S_BLKSIZE instead of magic constant.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-12 09:33:26 +00:00
Edward Tomasz Napierala
213ed83855 Fix autofs triggering problem. Assume you have an NFS server,
192.168.1.1, with share "share". This commit fixes a problem
where "mkdir /net/192.168.1.1/share/meh" would return spurious
error instead of creating the directory if the target filesystem
wasn't mounted yet; subsequent attempts would work correctly.

The failure scenario is kind of complicated to explain, but it all
boils down to calling VOP_MKDIR() for the target filesystem (NFS)
with wrong dvp - the autofs vnode instead of the filesystem root
mounted over it.

Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5442
2016-03-12 07:54:42 +00:00
Edward Tomasz Napierala
3e4adf76c4 Add assertion to catch duplicated notes.
Sponsored by:	The FreeBSD Foundation
2014-10-11 05:11:23 +00:00
Edward Tomasz Napierala
1609230854 Remove remnants of some cleanup; no functional changes.
Sponsored by:	The FreeBSD Foundation
2014-10-09 18:49:58 +00:00
Edward Tomasz Napierala
d19c297e5f Make autofs use shared vnode locks.
Reviewed by:	kib
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-10-04 09:37:40 +00:00
Edward Tomasz Napierala
2eaebf35d6 Make autofs(4) use shared lock for lookups, instead of exclusive one.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-10-03 09:58:05 +00:00
Edward Tomasz Napierala
759489f9e2 Make autofs timeout handling use timeout task instead of callout;
that's because the handler can sleep on sx lock.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-10-02 10:31:32 +00:00
Edward Tomasz Napierala
5a66f6b3c4 Fix thinko that, with two map entries like shown below, in that order,
made autofs mix them up: the second one wasn't visible in ls(1) output,
and trying to access it would trigger mount for the first one.

foobar		host:/foobar
foo		host:/foo

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2014-09-23 11:27:43 +00:00
Edward Tomasz Napierala
7cb570d0ae Fix bug that, assuming a/ is a root of NFS filesystem mounted on autofs,
prevented "mv a/from a/to" from working, while "cd a && mv from to" was ok.

PR:		192948
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-24 17:03:52 +00:00
Edward Tomasz Napierala
f81018caf2 Autofs softc needs to be global anyway, so don't pass it as a local
variable, and don't store in autofs_mount.  Also rename it from 'sc'
to 'autofs_softc', since it's global and extern.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-23 11:45:14 +00:00
Edward Tomasz Napierala
f5440d1a9d Fix includes.
Suggested by:	pluknet@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 15:59:25 +00:00
Edward Tomasz Napierala
925fd94584 Use __FBSDID() properly.
Suggested by:	pluknet@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 15:07:25 +00:00
Edward Tomasz Napierala
2f438a99cd Rework ".." lookup; previous one failed to properly busy the mountpoint.
Reviewed by:	kib@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-20 13:46:51 +00:00
Edward Tomasz Napierala
3914ddf8a7 Bring in the new automounter, similar to what's provided in most other
UNIX systems, eg. MacOS X and Solaris.  It uses Sun-compatible map format,
has proper kernel support, and LDAP integration.

There are still a few outstanding problems; they will be fixed shortly.

Reviewed by:	allanjude@, emaste@, kib@, wblock@ (earlier versions)
Phabric:	D523
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2014-08-17 09:44:42 +00:00