| Summary: | [autofs] automountd truncates labels > 23 characters long | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Jan Beich <jbeich> |
| Component: | kern | Assignee: | Edward Tomasz Napierala <trasz> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | hibler, trasz |
| Priority: | --- | Keywords: | needs-qa |
| Version: | CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Jan Beich
2015-11-10 04:08:05 UTC
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. |