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

zfs set userquota fail when the user id starts with number #428

Closed
erha opened this issue Oct 25, 2011 · 4 comments
Closed

zfs set userquota fail when the user id starts with number #428

erha opened this issue Oct 25, 2011 · 4 comments
Milestone

Comments

@erha
Copy link

erha commented Oct 25, 2011

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

@erha
Copy link
Author

erha commented Oct 25, 2011

Changes has to be made in file: lib\libzfs\libzfs_dataset.c line #2323, function: userquota_propname_decode.

@behlendorf
Copy link
Contributor

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?

@erha
Copy link
Author

erha commented Oct 27, 2011

Content of lib\libzfs\libzfs_dataset.c line #2323, function: userquota_propname_decode

} else if (!isdigit(*cp)) {
.
.
.
} else {
.
.
}

The isdigit will evaluate user id '1test' as true and thus it will continue to the next else statement....
But for sure, we shall not continue to the next else statement as the user id '1test' has to be translated to uid.

@schakrava
Copy link
Contributor

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.

Rudd-O pushed a commit to Rudd-O/zfs that referenced this issue Feb 1, 2012
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
kernelOfTruth pushed a commit to kernelOfTruth/zfs that referenced this issue Mar 1, 2015
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
sdimitro pushed a commit to sdimitro/zfs that referenced this issue May 23, 2022
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

No branches or pull requests

3 participants