Page MenuHomeFreeBSD

Remove name length limitation from autofs(5).
ClosedPublic

Authored by trasz on Feb 13 2016, 11:18 AM.
Tags
None
Referenced Files
F101691314: D5266.id14275.diff
Sat, Nov 2, 8:08 AM
Unknown Object (File)
Tue, Oct 29, 12:28 PM
Unknown Object (File)
Tue, Oct 29, 4:51 AM
Unknown Object (File)
Sat, Oct 26, 2:21 AM
Unknown Object (File)
Fri, Oct 25, 10:06 PM
Unknown Object (File)
Thu, Oct 24, 4:30 PM
Unknown Object (File)
Thu, Oct 24, 6:27 AM
Unknown Object (File)
Fri, Oct 18, 10:37 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2876
Build 2900: arc lint + arc unit

Event Timeline

trasz retitled this revision from to Remove name length limitation from autofs(5)..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)

Fix partial reads, and the namelen problem debugged by Mike Hibler.

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.

429

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.

429

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
429

This should be explained in a comment.

453

BTW, is the list stable for two disjoint calls to find the same children at the same offsets ?

sys/fs/autofs/autofs_vnops.c
453

Yes. The directories are append-only.

trasz edited edge metadata.

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
429

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
429

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.

kib edited edge metadata.
This revision is now accepted and ready to land.Mar 12 2016, 4:29 PM
This revision was automatically updated to reflect the committed changes.