Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource name length limit #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raltnoeder
Copy link
Member

This adds a macro defining the maximum length of resource names. I would have preferred a constant of type size_t, but everything else in this file is a macro, so I used one too for consistency.

There did not seem to be any explicit limit on the length of resource names in the kernel module, other than whatever space is left in the netlink messages for the corresponding field (but I did not search too thorougly, so maybe I'm wrong...).
Anyhow, this explicit limit of 127 bytes is the de facto limit of the new-resource command in the drbdsetup utility, since any longer name causes a failed assertion in drbdsetup.
As a result, it should be reasonably safe to conclude that longer names are not used in production anywhere, and establishing an explicit limit of 127 bytes in the kernel module will not break any existing installations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant