-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zfs set userquota fail when the user id starts with number #428
Comments
Changes has to be made in file: lib\libzfs\libzfs_dataset.c line #2323, function: userquota_propname_decode. |
I don't follow your second comment. Are you saying you have proposed change to fix this, or that the HAVE_IDMAP code in userquota_propname_decode() is somehow causing this issue? |
Content of lib\libzfs\libzfs_dataset.c line #2323, function: userquota_propname_decode } else if (!isdigit(*cp)) { The isdigit will evaluate user id '1test' as true and thus it will continue to the next else statement.... |
Thanks erha for pointing out the code. I just submitted a pull request. Tested the fix on ubuntu vm running 2.6.38-11-generic kernel. |
While setting/getting userquota and groupquota properties, the input was not treated as a possible username or groupname if it had a leading digit. While useradd in linux recommends the regexp [a-z_][a-z0-9_-]*[$]? , it is not enforced. This causes problem for usernames with leading digits in them. We need to be able to support getting and setting properties for this unconventional but possible input category I've updated the code to validate the username or groupname directly via the API. Also, note that I moved this validation to the beginning before the check for SID names with @. This also supports usernames with @ character in them which are valid. Only when input with @ is not a valid username, it is interpreted as a potential SID name. Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#428
For performance reasons the reworked kmem code maps vmem_alloc() to kmalloc_node() for allocations less than spa_kmem_alloc_max. This allows for more concurrency in the system and less contention of the virtual address space. Generally, this is a good thing. However, in the case when the kmalloc_node() fails it makes little sense to retry it using kmalloc_node() again. It will likely fail in exactly the same way. A smarter strategy is to abandon this optimization and retry using spl_vmalloc() which is very likely to succeed. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Ned Bass <[email protected]> Closes openzfs#428
Signed-off-by: Paul Dagnelie <[email protected]>
The zfs set userquota failed with error
cannot set property for 'tank': 'userquota@1test' has an invalid user/group name
.Command issued: zfs set userquota@1test=5G tank
ZFS version used: 0.6.0 rc6
OS: Centos 6
Linux Kernel: 2.6.32-71.29.1.el6.x86_64
The text was updated successfully, but these errors were encountered: