$ uname -a FreeBSD bar 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r290495M: Sat Nov 7 14:57:28 UTC 2015 foo@bar:/usr/obj/usr/src/sys/NONGENERIC amd64 1. Download http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-desktop-amd64.iso 2. Either flash it on a USB drive or emulate with something like DriveDroid 3. Uncomment -media in /etc/auto_master 4. automount; automountd; or use service(8) $ ls /media ls: Ubuntu 14.04.3 LTS amd6: No such file or directory da0s2 $ /etc/autofs/special_media da0s2 Ubuntu 14.04.3 LTS amd64 $ /etc/autofs/special_media | vis -w da0s2\012Ubuntu\04014.04.3\040LTS\040amd64\012 $ /etc/autofs/special_media 'Ubuntu 14.04.3 LTS amd6' $ /etc/autofs/special_media 'Ubuntu 14.04.3 LTS amd64' -fstype=cd9660,nosuid :/dev/da0 $ automountd -d automountd: waiting for request from the kernel automountd: not forking due to -d flag; will exit after servicing a single request automountd: got request 14: from map -media, path /media/, prefix "/media", key "Ubuntu 14.04.3 LTS amd6", options "nosuid" automountd: parsing map "-media" automountd: executing "/etc/autofs/special_media Ubuntu 14.04.3 LTS amd6" as pid 5493 automountd: "/etc/autofs/special_media Ubuntu 14.04.3 LTS amd6", pid 5493, terminated gracefully automountd: map may contain wildcard entries automountd: found node defined at [kernel request]:0; not a mountpoint automountd: creating subtree at /media automountd: nothing to mount; exiting automountd: completing request 14 with error 0 Can you reproduce? If not I'll try to debug my environment more.
Err, (2) step can also be done with mdconfig -f /path/to/ubuntu-14.04.3-desktop-amd64.iso
Better, (1) and (2) can be replaced with $ makefs -o label=$(jot -c - a z | rs -g) foo.img /rescue $ mdconfig -f foo.img which still leads to an error $ ls /media ls: abcdefghijklmnopqrstuvw: No such file or directory Kernel issue?
Kind of - you'll see it if you grep for AUTOFS_NAMELEN in sys/fs/autofs/. Right now the code uses dirents of fixed size, which simplifies it a lot. I'll see what I can do.
This 24 character limitation has been biting us as well. I completely understand the desire to use a fixed length for simplification, but why 24? Is that a "least common denominator" value for some known underlying filesystem type? It seems like MAXNAMLEN (255) would be a better choice.
There's an experimental patch at https://reviews.freebsd.org/D5266. Testing is welcome :-)
Thanks! I will give it a try next week.
(In reply to Edward Tomasz Napierala from comment #5) > https://reviews.freebsd.org/D5266 It does help, tested comment 0 and comment 2. However, FFS, ISO9660, NTFS don't allow labels > 32 characters long, FAT32, EXT4, XFS even less. With NFS hostname (FQDN) is treated as volume label. autofs: <= 251 works fine, 252-255 aborts with ENOENT, >= 256 label disappears from browsing. mount_nfs: > 80 aborts with ENAMETOOLONG. With FUSE my quick test choked on / (slash) truncating the label. # Android 5.1, TWRP 3.0, MTP-enabled $ simple-mtpfs -l 1: Google Inc (for LG Electronics/Samsung)Nexus 4/5/7/10 (MTP+ADB) $ ls -1 /mtp Google Inc (for LG Electronics $ ls -1 /mtp/"Google Inc (for LG Electronics" Internal Storage Micro SDCard
(In reply to Mike Hibler from comment #6) You fix works fine for me. But we are doing pretty straight-forward NFS mounts. Obviously Jan's use and testing are much more extensive and I will defer to Jan ging forward.
(In reply to Mike Hibler from comment #8) I take that back! It doesn't quite work right. The getcwd() function was getting massively confused, always thinking it was at the mountpoint no matter how far descended from the mountpoint you were. This was due to returning a rounded-up name length in autofs_readdir_one: namlen = roundup2(strlen(name) + 1, 4); ... dirent.d_namlen = namlen; Use of the rounded value is fine for computing reclen and doing the strlcpy(), but the true name length needs to be returned in d_namlen: dirent.d_namlen = strlen(name); Now it seems to be working fine.
A commit references this bug: Author: trasz Date: Sun Mar 13 14:17:23 UTC 2016 New revision: 296798 URL: https://svnweb.freebsd.org/changeset/base/296798 Log: 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 Changes: head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vnops.c
Ok, stuff should work correctly now; testing is welcome. Regarding the slashes - there's nothing that autofs can do in this case, the dynamic map should be updated to replace pluses and slashes with eg '-'. I've just committed a fix to special_media that does that.
I don't plan to MFC this back to 10-STABLE.