Skip to content

Commit

Permalink
autofs: rename 'autofs' module back to 'autofs4'
Browse files Browse the repository at this point in the history
It turns out that systemd has a bug: it wants to load the autofs module
early because of some initialization ordering with udev, and it doesn't
do that correctly.  Everywhere else it does the proper "look up module
name" that does the proper alias resolution, but in that early code, it
just uses a hardcoded "autofs4" for the module name.

The result of that is that as of commit a2225d9 ("autofs: remove
left-over autofs4 stubs"), you get

    systemd[1]: Failed to insert module 'autofs4': No such file or directory

in the system logs, and a lack of module loading.  All this despite the
fact that we had very clearly marked 'autofs4' as an alias for this
module.

What's so ridiculous about this is that literally everything else does
the module alias handling correctly, including really old versions of
systemd (that just used 'modprobe' to do this), and even all the other
systemd module loading code.

Only that special systemd early module load code is broken, hardcoding
the module names for not just 'autofs4', but also "ipv6", "unix",
"ip_tables" and "virtio_rng".  Very annoying.

Instead of creating an _additional_ separate compatibility 'autofs4'
module, just rely on the fact that everybody else gets this right, and
just call the module 'autofs4' for compatibility reasons, with 'autofs'
as the alias name.

That will allow the systemd people to fix their bugs, adding the proper
alias handling, and maybe even fix the name of the module to be just
"autofs" (so that they can _test_ the alias handling).  And eventually,
we can revert this silly compatibility hack.

See also

    systemd/systemd#9501
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902946

for the systemd bug reports upstream and in the Debian bug tracker
respectively.

Fixes: a2225d9 ("autofs: remove left-over autofs4 stubs")
Reported-by: Ben Hutchings <[email protected]>
Reported-by: Michael Biebl <[email protected]>
Cc: Ian Kent <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Jul 5, 2018
1 parent 06c8563 commit d02d21e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fs/autofs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Makefile for the linux autofs-filesystem routines.
#

obj-$(CONFIG_AUTOFS_FS) += autofs.o
obj-$(CONFIG_AUTOFS_FS) += autofs4.o

autofs-objs := init.o inode.o root.o symlink.o waitq.o expire.o dev-ioctl.o
autofs4-objs := init.o inode.o root.o symlink.o waitq.o expire.o dev-ioctl.o
2 changes: 1 addition & 1 deletion fs/autofs/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static struct file_system_type autofs_fs_type = {
.kill_sb = autofs_kill_sb,
};
MODULE_ALIAS_FS("autofs");
MODULE_ALIAS("autofs4");
MODULE_ALIAS("autofs");

static int __init init_autofs_fs(void)
{
Expand Down

0 comments on commit d02d21e

Please sign in to comment.