Page MenuHomeFreeBSD

Remove name length limitation from autofs(5).
ClosedPublic

Authored by trasz on Feb 13 2016, 11:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 12, 5:55 PM
Unknown Object (File)
Mon, Sep 9, 1:37 AM
Unknown Object (File)
Sun, Sep 8, 7:47 PM
Unknown Object (File)
Sun, Sep 8, 11:12 AM
Unknown Object (File)
Sun, Sep 8, 8:17 AM
Unknown Object (File)
Sat, Sep 7, 6:45 PM
Unknown Object (File)
Sat, Sep 7, 12:58 PM
Unknown Object (File)
Wed, Sep 4, 8:17 PM
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 2479
Build 2496: 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
363

Could the magic '4' constant replaced by __alignof(struct dirent) ?

369–370

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.

381

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.

390

The KASSERT is rather useless.

427

What does this check try to achieve ?

(I agree with the parts I didn't comment upon, btw.)

sys/fs/autofs/autofs_vnops.c
390

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.

427

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
427

This should be explained in a comment.

446

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

sys/fs/autofs/autofs_vnops.c
446

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
427

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
427

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.