Remove name length limitation from autofs(5). The linear search with
strlens is rather suboptimal, but it's a temporary measure that will be
replaced with red-black trees later on.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2877 Build 2901: arc lint + arc unit
Event Timeline
I have absolutely no intent of digging into the bug report and debugging the issue to understand what the problem is.
If you do not bother to explain what is the problem and what is the fix, why should I spend time on this ?
Ah, sorry. Basically, for simplicity autofs used fixed length dirents, and this means there's a name length limit. This patch makes it use variable-length dirents, thus removing the name length limitation.
Overall it looks fine.
sys/fs/autofs/autofs_vnops.c | ||
---|---|---|
345 | Could the magic '4' constant replaced by __alignof(struct dirent) ? | |
357–358 | You do not need this memset, you only need to clear the unfilled portion of the memory after the factual end of the string, which is 3 bytes max. | |
367 | Please remove all blank lines from the function (and other places touched by the patch), except the blank line after locals declaration block. Style(9) requests blank line to delimit the scope of the code, explained by previous multi-line comment. | |
376 | The KASSERT is rather useless. | |
431 | What does this check try to achieve ? |
(I agree with the parts I didn't comment upon, btw.)
sys/fs/autofs/autofs_vnops.c | ||
---|---|---|
376 | It was supposed to quiet down static analysis tools, like Coverity, but on the other hand such a tool should be smart enough to figure out that there can be no error returned here. So ok, I'll remove it. | |
431 | It's to detect whether we should copy out the ".." entry or not, based on the current offset into the directory. |
sys/fs/autofs/autofs_vnops.c | ||
---|---|---|
464 | Yes. The directories are append-only. |
Remove magic constant, don't zero out things that are overwritten
anyway, remove useless KASSERT, and improve comments.
I've tried removing the whitespace, but it makes things harder
to read for me. Sorry, it's a personal thing; I just prefer to have
more whitespace.
sys/fs/autofs/autofs_vnops.c | ||
---|---|---|
431 | The comment still does not explain the check in if(), it restates what the code does inside the 'then' block. |
Update comments.
sys/fs/autofs/autofs_vnops.c | ||
---|---|---|
431 | Ok, I've updated the comment on the first block (the one for ".") to mention the offset check, and that it applies to the others. |